[PATCH] D106989: [IRSim] Finding Branch Similarity

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 12:55:29 PDT 2021


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

The current IRSimilarityIdentifier does not try to find similarity across blocks, this patch provides a mechanism to compare two branches against one another, to find similarity across basic blocks, rather than just within them.

This adds a step in the similarity identification process that labels all of the basic blocks so that we can identify the relative branching locations.  Within an IRSimilarityCandidate we use these relative locations to determine whether if the branching to other relative locations in the same region is the same between branches.  If they are, we consider them similar.

We do not consider the relative location of the branch if the target branch is outside of the region.  In this case, both branches must exit to a location outside the region, but the exact relative location does not matter.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106989

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106989.362502.patch
Type: text/x-patch
Size: 26726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210728/aa5887f5/attachment.bin>


More information about the llvm-commits mailing list