[all-commits] [llvm/llvm-project] 7e4c6f: [IRSim] Adding IR Instruction Mapper

Andrew Litteken via All-commits all-commits at lists.llvm.org
Thu Sep 17 12:09:24 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e4c6fb854660318dc31ecb9842f6cfebb18c8e0
      https://github.com/llvm/llvm-project/commit/7e4c6fb854660318dc31ecb9842f6cfebb18c8e0
  Author: Andrew Litteken <andrew_litteken at apple.com>
  Date:   2020-09-17 (Thu, 17 Sep 2020)

  Changed paths:
    A llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
    M llvm/lib/Analysis/CMakeLists.txt
    A llvm/lib/Analysis/IRSimilarityIdentifier.cpp
    M llvm/unittests/Analysis/CMakeLists.txt
    A llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp

  Log Message:
  -----------
  [IRSim] Adding IR Instruction Mapper

This introduces the IRInstructionMapper, and the associated wrapper for
instructions, IRInstructionData, that maps IR level Instructions to
unsigned integers.

Mapping is done mainly by using the "isSameOperationAs" comparison
between two instructions.  If they return true, the opcode, result type,
and operand types of the instruction are used to hash the instruction
with an unsigned integer.  The mapper accepts instruction ranges, and
adds each resulting integer to a list, and each wrapped instruction to
a separate list.

At present, branches, phi nodes are not mapping and exception handling
is illegal.  Debug instructions are not considered.

The different mapping schemes are tested in
unittests/Analysis/IRSimilarityIdentifierTest.cpp

Recommit of: b04c1a9d3127730c05e8a22a0e931a12a39528df

Differential Revision: https://reviews.llvm.org/D86968




More information about the All-commits mailing list