Utility class for extracting code into a new function.
Declared in <llvm/Transforms/Utils/CodeExtractor.h>
class CodeExtractor;
This utility provides a simple interface for extracting some sequence of code into its own function, replacing it with a call to that function. It also provides various methods to query about the nature and result of such a transformation.
The rough algorithm used is: 1) Find both the inputs and outputs for the extracted region. 2) Pass the inputs as arguments, remapping them within the extracted function to arguments. 3) Add allocas for any scalar outputs, adding all of the outputs' allocas as arguments, and inserting stores to the arguments for any scalars.
| Name | Description |
|---|---|
CodeExtractor [constructor] | Create a code extractor for a sequence of blocks. |
~CodeExtractor [destructor] [virtual] | Destructor |
excludeArgFromAggregate | Exclude a value from aggregate argument passing when extracting a code region, passing it instead as a scalar. |
extractCodeRegion | extractCodeRegion overloads |
findAllocas | Find the set of allocas whose life ranges are contained within the outlined region. |
findInputsOutputs | Compute the set of input values and output values for the code. |
findOrCreateBlockForHoisting | Find or create a block within the outline region for placing hoisted code. |
isEligible | Test whether this code extractor is eligible. |
isLegalToShrinkwrapLifetimeMarkers | Check if life time marker nodes can be hoisted/sunk into the outline region. |
| Name | Description |
|---|---|
verifyAssumptionCache | Verify that assumption cache isn't stale after a region is extracted. Returns true when verifier finds errors. AssumptionCache is passed as parameter to make this function stateless. |
| Name | Description |
|---|---|
allocateVar [virtual] | Allocate an intermediate variable at the specified point. |
deallocateVar [virtual] | Deallocate a previously-allocated intermediate variable at the specified point. |