LLVM: llvm::IRSimilarity::IRSimilarityIdentifier Class Reference (original) (raw)

This class puts all the pieces of the IRInstructionData, IRInstructionMapper, IRSimilarityCandidate together.

It first feeds the Module or vector of Modules into the IRInstructionMapper, and puts all the mapped instructions into a single long list of IRInstructionData.

The list of unsigned integers is given to the Suffix Tree or similar data structure to find repeated subsequences. We construct an IRSimilarityCandidate for each instance of the subsequence. We compare them against one another since These repeated subsequences can have different structure. For each different kind of structure found, we create a similarity group.

If we had four IRSimilarityCandidates A, B, C, and D where A, B and D are structurally similar to one another, while C is different we would have two SimilarityGroups:

SimilarityGroup 1: SimilarityGroup 2 A, B, D C

A list of the different similarity groups is then returned after analyzing the module.

Definition at line 1043 of file IRSimilarityIdentifier.h.