struct OutlinableGroup
Declaration
struct OutlinableGroup { /* full declaration omitted */ };
Description
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.
Declared at: llvm/lib/Transforms/IPO/IROutliner.cpp:73
Member Variables
- public std::vector<OutlinableRegion*> Regions
- The sections that could be outlined
- public std::vector<Type*> ArgumentTypes
- The argument types for the function created as the overall function to replace the extracted function for each region.
- public llvm::FunctionType* OutlinedFunctionType = nullptr
- The FunctionType for the overall function.
- public llvm::Function* OutlinedFunction = nullptr
- The Function for the collective overall function.
- public bool IgnoreGroup = false
- Flag for whether we should not consider this group of OutlinableRegions for extraction.
- public DenseMap<llvm::Value*, llvm::BasicBlock*> EndBBs
- The return blocks for the overall function.
- public DenseMap<llvm::Value*, llvm::BasicBlock*> PHIBlocks
- The PHIBlocks with their corresponding return block based on the return value as the key.
- public DenseSet<ArrayRef<unsigned int>> OutputGVNCombinations
- 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.
- public bool InputTypesSet = false
- Flag for whether the \ref ArgumentTypes have been defined after the extraction of the first region.
- public unsigned int NumAggregateInputs = 0
- The number of input values in \ref ArgumentTypes. Anything after this index in ArgumentTypes is an output argument.
- public DenseMap<unsigned int, unsigned int> CanonicalNumberToAggArg
- The mapping of the canonical numbering of the values in outlined sections to specific arguments.
- public unsigned int BranchesToOutside = 0
- The number of branches in the region target a basic block that is outside of the region.
- public unsigned int 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.
- public DenseMap<unsigned int, std::pair<std::pair<unsigned int, unsigned int>, SmallVector<unsigned int, 2>>> PHINodeGVNToGVNs
- public DenseMap<llvm::hash_code, unsigned int> GVNsToPHINodeGVN
- public llvm::InstructionCost Benefit = 0
- The number of instructions that will be outlined by extracting \ref Regions.
- public llvm::InstructionCost Cost = 0
- The number of added instructions needed for the outlining of the \ref Regions.
- public Optional<unsigned int> SwiftErrorArgument
- The argument that needs to be marked with the swifterr attribute. If not needed, there is no value.
Method Overview
- public void collectGVNStoreSets(llvm::Module & M)
- public void findSameConstants(DenseSet<unsigned int> & NotSame)
Methods
¶void collectGVNStoreSets(llvm::Module& M)
void collectGVNStoreSets(llvm::Module& M)
Description
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.
Declared at: llvm/lib/Transforms/IPO/IROutliner.cpp:150
Parameters
- llvm::Module& M
- - The module we are outlining from.
¶void findSameConstants(
DenseSet<unsigned int>& NotSame)
void findSameConstants(
DenseSet<unsigned int>& NotSame)
Description
For the \ref Regions, we look at every Value. If it is a constant, we check whether it is the same in Region.
Declared at: llvm/lib/Transforms/IPO/IROutliner.cpp:143
Parameters
- DenseSet<unsigned int>& NotSame
- contains the global value numbers where the constant is not always the same, and must be passed in as an argument.