Extracted regions can have both inputs and outputs. In addition, the CodeExtractor removes inputs that are only used in llvm.assumes, and sunken allocas (values are used entirely in the extracted region as denoted by lifetime intrinsics). We also cannot combine sections that have different constants in the same structural location, and these constants will have to be elevated to arguments. This patch limits the extracted regions to those that only require inputs, and do not have any other special cases.
We test that we do not outline the wrong constants in:
- test/Transforms/IROutliner/outliner-different-constants.ll
- test/Transforms/IROutliner/outliner-different-globals.ll
- test/Transforms/IROutliner/outliner-constant-vs-registers.ll
We test that correctly outline in:
- test/Transforms/IROutliner/outlining-same-globals.ll
- test/Transforms/IROutliner/outlining-same-constants.ll
- test/Transforms/IROutliner/outlining-different-structure.ll
Can these white space changes be in an NFC commit?