[PATCH] D86968: [IRSim] Adding IR Instruction Mapper

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 13:09:36 PDT 2020


AndrewLitteken created this revision.
Herald added subscribers: llvm-commits, jfb, hiraditya, mgorny.
Herald added a project: LLVM.
AndrewLitteken requested review of this revision.

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`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86968

Files:
  llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
  llvm/lib/Analysis/CMakeLists.txt
  llvm/lib/Analysis/IRSimilarityIdentifier.cpp
  llvm/unittests/Analysis/CMakeLists.txt
  llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86968.289260.patch
Type: text/x-patch
Size: 65980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200901/c2395ff2/attachment-0001.bin>


More information about the llvm-commits mailing list