Certain regions can have values introduced inside the region that are used outside of the region. These may not be the same for each similar region, so we must create one over arching set of arguments for the consolidated function.
We do this by iterating over the outputs for each extracted function, and creating as many different arguments to encapsulate the different outputs sets. For each output set, we create a different block with the necessary stores from the value to the output register. There is then one switch statement, controlled by an argument to the function, to differentiate which block to use.
Changed Tests for consistency:
- llvm/test/Transforms/IROutliner/extraction.ll
- llvm/test/Transforms/IROutliner/illegal-assumes.ll
- llvm/test/Transforms/IROutliner/illegal-memcpy.ll
- llvm/test/Transforms/IROutliner/illegal-memmove.ll
- llvm/test/Transforms/IROutliner/illegal-vaarg.ll
Tests to test new functionality:
- llvm/test/Transforms/IROutliner/outlining-different-output-blocks.ll
- llvm/test/Transforms/IROutliner/outlining-remapped-outputs.ll
- llvm/test/Transforms/IROutliner/outlining-same-output-blocks.ll
const DenseMap &?