[PATCH] D106443: [IRSim][IROutliner] Adding support for recognizing and outlining branches

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 07:17:26 PDT 2021


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

This adds support to both the IRSimilarityIdentifier and IROutliner to recognize similarity between branches.  We consider two branches to be close to one another if they have the same number of potential branching locations.  Within a region, we use the numbering method to determine if two branches contain the same values, but we also check to ensure that two corresponding branches:

- Branch to an internal basic block to the region, or outside basic block to the region at the same time
- Branch to the same relative block location if targeting an internal branch

When outlining blocks, we have special handling if our multiple exit approach splits any PHINodes.  We have different rewrites rules that detect when this occurs, and make sure any values needed are propagated, and are included in the overall function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106443

Files:
  llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
  llvm/include/llvm/Transforms/IPO/IROutliner.h
  llvm/lib/Analysis/IRSimilarityIdentifier.cpp
  llvm/lib/Transforms/IPO/IROutliner.cpp
  llvm/test/Transforms/IROutliner/outlining-across-branch.ll
  llvm/test/Transforms/IROutliner/outlining-basic-branches.ll
  llvm/test/Transforms/IROutliner/outlining-branches-phi-nodes.ll
  llvm/test/Transforms/IROutliner/outlining-conditional-match.ll
  llvm/test/Transforms/IROutliner/outlining-multiple-exits-diff-outputs.ll
  llvm/test/Transforms/IROutliner/outlining-multiple-exits.ll
  llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106443.360442.patch
Type: text/x-patch
Size: 95021 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210721/db9ea6ba/attachment-0001.bin>


More information about the llvm-commits mailing list