[all-commits] [llvm/llvm-project] c172f1: [IROutliner] Adding supports for multiple exits
Andrew Litteken via All-commits
all-commits at lists.llvm.org
Wed Sep 8 09:08:50 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c172f1ad39cbc1f4b3aa2d57c18dbe4c986151b9
https://github.com/llvm/llvm-project/commit/c172f1ad39cbc1f4b3aa2d57c18dbe4c986151b9
Author: Andrew Litteken <andrew_litteken at apple.com>
Date: 2021-09-08 (Wed, 08 Sep 2021)
Changed paths:
M llvm/lib/Transforms/IPO/IROutliner.cpp
A llvm/test/Transforms/IROutliner/outlining-exits-to-phi-node.ll
A llvm/test/Transforms/IROutliner/outlining-multiple-exits-diff-outputs.ll
A llvm/test/Transforms/IROutliner/outlining-multiple-exits-one-output-set.ll
M llvm/test/Transforms/IROutliner/outlining-multiple-exits.ll
Log Message:
-----------
[IROutliner] Adding supports for multiple exits
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.
Reviewers: paquette
Differential Revision: https://reviews.llvm.org/D106993
More information about the All-commits
mailing list