[IRSim] Adding structural comparison to IRSimilarityCandidate.
authorAndrew Litteken <andrew.litteken@gmail.com>
Wed, 23 Sep 2020 16:04:39 +0000 (11:04 -0500)
committerAndrew Litteken <andrew.litteken@gmail.com>
Thu, 24 Sep 2020 03:42:30 +0000 (22:42 -0500)
commitd1aa143aa84e20a8cdef24a0b5ccf70941884534
tree235d5bdb537cbe459fe334709db385ea13541105
parent0a8e097e72dfc148df1d9345aba52e75cdc5aa50
[IRSim] Adding structural comparison to IRSimilarityCandidate.

Just because sequences of instructions are similar to one another,
doesn't mean they are doing the same thing.

This introduces a structural check for the IRSimilarityCandidate that
compares two IRSimilarityCandidates against one another, and in each
instruction creates a mapping between the operands and results, or
checks that the existing mapping is valid.  If this check passes, it
means we have structurally similar IRSimilarityCandidates.

Tests for whether the candidates are found in
unittests/Analysis/IRSimilarityIdentifierTest.cpp.

Recommit of: b27db2bb68163fa5bcb4a8f631a305eb5adb44e5 for Differential
URL.

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