LLVM 20.0.0git
|
The OutlinableGroup holds all the overarching information for outlining a set of regions that are structurally similar to one another, such as the types of the overall function, the output blocks, the sets of stores needed and a list of the different regions. More...
Public Member Functions | |
void | findSameConstants (DenseSet< unsigned > &NotSame) |
For the Regions, we look at every Value. | |
void | collectGVNStoreSets (Module &M) |
For the regions, look at each set of GVN stores needed and account for each combination. | |
Public Attributes | |
std::vector< OutlinableRegion * > | Regions |
The sections that could be outlined. | |
std::vector< Type * > | ArgumentTypes |
The argument types for the function created as the overall function to replace the extracted function for each region. | |
FunctionType * | OutlinedFunctionType = nullptr |
The FunctionType for the overall function. | |
Function * | OutlinedFunction = nullptr |
The Function for the collective overall function. | |
bool | IgnoreGroup = false |
Flag for whether we should not consider this group of OutlinableRegions for extraction. | |
DenseMap< Value *, BasicBlock * > | EndBBs |
The return blocks for the overall function. | |
DenseMap< Value *, BasicBlock * > | PHIBlocks |
The PHIBlocks with their corresponding return block based on the return value as the key. | |
DenseSet< ArrayRef< unsigned > > | OutputGVNCombinations |
A set containing the different GVN store sets needed. | |
bool | InputTypesSet = false |
Flag for whether the ArgumentTypes have been defined after the extraction of the first region. | |
unsigned | NumAggregateInputs = 0 |
The number of input values in ArgumentTypes. | |
DenseMap< unsigned, unsigned > | CanonicalNumberToAggArg |
The mapping of the canonical numbering of the values in outlined sections to specific arguments. | |
unsigned | BranchesToOutside = 0 |
The number of branches in the region target a basic block that is outside of the region. | |
unsigned | PHINodeGVNTracker = -3 |
Tracker counting backwards from the highest unsigned value possible to avoid conflicting with the GVNs of assigned values. | |
DenseMap< unsigned, std::pair< std::pair< unsigned, unsigned >, SmallVector< unsigned, 2 > > > | PHINodeGVNToGVNs |
DenseMap< hash_code, unsigned > | GVNsToPHINodeGVN |
InstructionCost | Benefit = 0 |
The number of instructions that will be outlined by extracting Regions. | |
InstructionCost | Cost = 0 |
The number of added instructions needed for the outlining of the Regions. | |
std::optional< unsigned > | SwiftErrorArgument |
The argument that needs to be marked with the swifterr attribute. | |
The OutlinableGroup holds all the overarching information for outlining a set of regions that are structurally similar to one another, such as the types of the overall function, the output blocks, the sets of stores needed and a list of the different regions.
This information is used in the deduplication of extracted regions with the same structure.
Definition at line 72 of file IROutliner.cpp.
void OutlinableGroup::collectGVNStoreSets | ( | Module & | M | ) |
For the regions, look at each set of GVN stores needed and account for each combination.
Add an argument to the argument types if there is more than one combination.
[in] | M | - The module we are outlining from. |
Definition at line 605 of file IROutliner.cpp.
References llvm::Type::getInt32Ty(), and OS.
For the Regions, we look at every Value.
If it is a constant, we check whether it is the same in Region.
[in,out] | NotSame | contains the global value numbers where the constant is not always the same, and must be passed in as an argument. |
Definition at line 598 of file IROutliner.cpp.
References collectRegionsConstants().
std::vector<Type *> OutlinableGroup::ArgumentTypes |
The argument types for the function created as the overall function to replace the extracted function for each region.
Definition at line 78 of file IROutliner.cpp.
Referenced by findExtractedInputToOverallInputMapping(), and findExtractedOutputToOverallOutputMapping().
InstructionCost OutlinableGroup::Benefit = 0 |
The number of instructions that will be outlined by extracting Regions.
Definition at line 128 of file IROutliner.cpp.
unsigned OutlinableGroup::BranchesToOutside = 0 |
The number of branches in the region target a basic block that is outside of the region.
Definition at line 114 of file IROutliner.cpp.
Referenced by findCostForOutputBlocks().
The mapping of the canonical numbering of the values in outlined sections to specific arguments.
Definition at line 110 of file IROutliner.cpp.
Referenced by findExtractedInputToOverallInputMapping().
InstructionCost OutlinableGroup::Cost = 0 |
The number of added instructions needed for the outlining of the Regions.
Definition at line 131 of file IROutliner.cpp.
DenseMap<Value *, BasicBlock *> OutlinableGroup::EndBBs |
The return blocks for the overall function.
Definition at line 89 of file IROutliner.cpp.
Referenced by createSwitchStatement(), fillOverallFunction(), and findOrCreatePHIBlock().
Definition at line 124 of file IROutliner.cpp.
Referenced by getGVNForPHINode().
bool OutlinableGroup::IgnoreGroup = false |
Flag for whether we should not consider this group of OutlinableRegions for extraction.
Definition at line 86 of file IROutliner.cpp.
bool OutlinableGroup::InputTypesSet = false |
Flag for whether the ArgumentTypes have been defined after the extraction of the first region.
Definition at line 102 of file IROutliner.cpp.
Referenced by findExtractedInputToOverallInputMapping().
unsigned OutlinableGroup::NumAggregateInputs = 0 |
The number of input values in ArgumentTypes.
Anything after this index in ArgumentTypes is an output argument.
Definition at line 106 of file IROutliner.cpp.
Referenced by findExtractedInputToOverallInputMapping(), and findExtractedOutputToOverallOutputMapping().
Function* OutlinableGroup::OutlinedFunction = nullptr |
The Function for the collective overall function.
Definition at line 82 of file IROutliner.cpp.
Referenced by createSwitchStatement(), fillOverallFunction(), findOrCreatePHIInBlock(), replaceArgumentUses(), replaceCalledFunction(), and replaceConstants().
FunctionType* OutlinableGroup::OutlinedFunctionType = nullptr |
The FunctionType for the overall function.
Definition at line 80 of file IROutliner.cpp.
A set containing the different GVN store sets needed.
Each array contains a sorted list of the different values that need to be stored into output registers.
Definition at line 98 of file IROutliner.cpp.
Referenced by createSwitchStatement(), findCostForOutputBlocks(), and replaceCalledFunction().
DenseMap<Value *, BasicBlock *> OutlinableGroup::PHIBlocks |
The PHIBlocks with their corresponding return block based on the return value as the key.
Definition at line 93 of file IROutliner.cpp.
Referenced by findOrCreatePHIBlock(), and replaceArgumentUses().
DenseMap<unsigned, std::pair<std::pair<unsigned, unsigned>, SmallVector<unsigned, 2> > > OutlinableGroup::PHINodeGVNToGVNs |
Definition at line 123 of file IROutliner.cpp.
Referenced by findOutputValueInRegion(), and getGVNForPHINode().
unsigned OutlinableGroup::PHINodeGVNTracker = -3 |
Tracker counting backwards from the highest unsigned value possible to avoid conflicting with the GVNs of assigned values.
We start at -3 since -2 and -1 are assigned by the DenseMap.
Definition at line 119 of file IROutliner.cpp.
Referenced by findOutputValueInRegion(), and getGVNForPHINode().
std::vector<OutlinableRegion *> OutlinableGroup::Regions |
The sections that could be outlined.
Definition at line 74 of file IROutliner.cpp.
Referenced by fillOverallFunction(), findCostForOutputBlocks(), findOrCreatePHIInBlock(), getSubprogramOrNull(), and replaceArgumentUses().
std::optional<unsigned> OutlinableGroup::SwiftErrorArgument |
The argument that needs to be marked with the swifterr attribute.
If not needed, there is no value.
Definition at line 135 of file IROutliner.cpp.
Referenced by findExtractedInputToOverallInputMapping(), and replaceCalledFunction().