[IRSim] Adding a basic similarity identifier.
authorAndrew Litteken <andrew.litteken@gmail.com>
Thu, 17 Sep 2020 20:12:08 +0000 (15:12 -0500)
committerAndrew Litteken <andrew.litteken@gmail.com>
Thu, 24 Sep 2020 07:05:25 +0000 (02:05 -0500)
commitb63bfc2030dedf1f94fd074805993b53c5a71caf
tree5fe0e162939cb52d6eeff54cc114689e0a766e45
parent505ac22f1a1ada261280d979862d8af541016f77
[IRSim] Adding a basic similarity identifier.

This takes the mapped instructions from the IRInstructionMapper, and
passes it to the Suffix Tree to find the repeated substrings.  Within
each set of repeated substrings, the IRSimilarityCandidates are compared
against one another for structure, and ensuring that the operands in the
instructions are used in the same way.  Each of these structurally
similarity IRSimilarityCandidates are contained in a SimilarityGroup.

Tests checking for identifying identity of structure, different
isomorphic structure, and different
nonisomoprhic structure are found in
unittests/Analysis/IRSimilarityIdentifierTest.cpp.

Differential Revision: https://reviews.llvm.org/D86972
llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
llvm/lib/Analysis/IRSimilarityIdentifier.cpp
llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp