[PATCH] D87311: [IRSim] Adding commutativity matching to structure checking

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 11:36:04 PDT 2020


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

Certain instructions, such as adds and multiplies can have the operands flipped and still be considered the same.  When we are analyzing structure, this gives slightly more flexibility to create a mapping from one region to another.  We can add both operands in a corresponding instruction to an operand rather than just the exact match.  We then try to eliminate items from the set, until there is only one valid mapping between the regions of code.

We do this for adds, multiplies, and equality checking.  However, this is not done for floating point instructions, since the order can still matter in some cases.

Tests:

- llvm/test/Transforms/IROutliner/outlining-commutative-fp.ll
- llvm/test/Transforms/IROutliner/outlining-commutative.ll
- llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87311

Files:
  llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
  llvm/lib/Analysis/IRSimilarityIdentifier.cpp
  llvm/test/Transforms/IROutliner/outlining-commutative-fp.ll
  llvm/test/Transforms/IROutliner/outlining-commutative.ll
  llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87311.290546.patch
Type: text/x-patch
Size: 26588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200908/8eb641fc/attachment.bin>


More information about the llvm-commits mailing list