[PATCH] D106993: [IROutliner] Outline across branches with multiple exits

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 13:04:31 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.

When we start outlining across branches, there is the possibility that we will have two different blocks with different output locations, or a single branch that goes to two blocks outside of the region that is being outlined.  While the CodeExtractor provides most of the mechanisms by using the return value of the extracted function as the input to a switch statement to correctly branch to the correct location, we need special handling for different output schemas to each location.

This is done by repeating the existing storing scheme for each different exit block.  We have a map from the return values used, to the basic block that is used to store the outputs for that particular exit block within the outlined function.  Then if needed, we create a switch statement for each return block to branch to the correct set of stored outputs.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106993

Files:
  llvm/include/llvm/Transforms/IPO/IROutliner.h
  llvm/lib/Transforms/IPO/IROutliner.cpp
  llvm/test/Transforms/IROutliner/outlining-multiple-exits-diff-outputs.ll
  llvm/test/Transforms/IROutliner/outlining-multiple-exits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106993.362505.patch
Type: text/x-patch
Size: 44706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210728/5434284f/attachment-0001.bin>


More information about the llvm-commits mailing list