class LoadStoreOpt
Declaration
class LoadStoreOpt : public MachineFunctionPass { /* full declaration omitted */ };
Description
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of passes that operate on the MachineFunction representation. Instead of overriding runOnFunction, subclasses override runOnMachineFunction.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:62
Inherits from: MachineFunctionPass
Member Variables
- private std::function<bool(const MachineFunction&)> DoNotRunPass
- An input function to decide if the pass should run or not on the given MachineFunction.
- private llvm::MachineRegisterInfo* MRI
- private const llvm::TargetLowering* TLI
- private llvm::MachineFunction* MF
- private llvm::AliasAnalysis* AA
- private const llvm::LegalizerInfo* LI
- private llvm::MachineIRBuilder Builder
- private DenseMap<unsigned int, llvm::BitVector> LegalStoreSizes
- A map between address space numbers and a bitvector of supported stores sizes. Each bit in the bitvector represents whether a store size of that bit's value is legal. E.g. if bit 64 is set, then 64 bit scalar stores are legal.
- private bool IsPreLegalizer
- private SmallSet<llvm::MachineInstr*, 16> InstsToErase
- Contains instructions to be erased at the end of a block scan.
- public static char ID
Method Overview
- public LoadStoreOpt()
- public LoadStoreOpt(std::function<bool (const MachineFunction &)>)
- private bool addStoreToCandidate(llvm::GStore & MI, llvm::LoadStoreOpt::StoreMergeCandidate & C)
- private bool doSingleStoreMerge(SmallVectorImpl<llvm::GStore *> & Stores)
- public void getAnalysisUsage(llvm::AnalysisUsage & AU) const
- public llvm::StringRef getPassName() const
- public llvm::MachineFunctionProperties getRequiredProperties() const
- private void init(llvm::MachineFunction & MF)
- private void initializeStoreMergeTargetInfo(unsigned int AddrSpace = 0)
- private bool isLegalOrBeforeLegalizer(const llvm::LegalityQuery & Query, llvm::MachineFunction & MF) const
- private bool mergeBlockStores(llvm::MachineBasicBlock & MBB)
- private bool mergeFunctionStores(llvm::MachineFunction & MF)
- private bool mergeStores(SmallVectorImpl<llvm::GStore *> & StoresToMerge)
- private bool operationAliasesWithCandidate(llvm::MachineInstr & MI, llvm::LoadStoreOpt::StoreMergeCandidate & C)
- private bool processMergeCandidate(llvm::LoadStoreOpt::StoreMergeCandidate & C)
- public bool runOnMachineFunction(llvm::MachineFunction & MF)
Inherited from MachineFunctionPass:
- public doInitialization
- protected getAnalysisUsage
- protected getClearedProperties
- protected getRequiredProperties
- protected getSetProperties
- protected runOnMachineFunction
Inherited from FunctionPass:
- public assignPassManager
- public createPrinterPass
- public getPotentialPassManagerType
- public runOnFunction
- protected skipFunction
Inherited from Pass:
- public assignPassManager
- public createPass
- public createPrinterPass
- public doFinalization
- public doInitialization
- public dump
- public dumpPassStructure
- public getAdjustedAnalysisPointer
- public getAnalysis
- public getAnalysis
- public getAnalysisID
- public getAnalysisID
- public getAnalysisIfAvailable
- public getAnalysisUsage
- public getAsImmutablePass
- public getAsPMDataManager
- public getPassID
- public getPassKind
- public getPassName
- public getPotentialPassManagerType
- public getResolver
- public lookupPassInfo
- public lookupPassInfo
- public mustPreserveAnalysisID
- public preparePassManager
- public print
- public releaseMemory
- public setResolver
- public verifyAnalysis
Methods
¶LoadStoreOpt()
LoadStoreOpt()
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:148
¶LoadStoreOpt(
std::function<bool(const MachineFunction&)>)
LoadStoreOpt(
std::function<bool(const MachineFunction&)>)
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:149
Parameters
- std::function<bool(const MachineFunction&)>
¶bool addStoreToCandidate(
llvm::GStore& MI,
llvm::LoadStoreOpt::StoreMergeCandidate& C)
bool addStoreToCandidate(
llvm::GStore& MI,
llvm::LoadStoreOpt::StoreMergeCandidate& C)
Description
If the given store is valid to be a member of the candidate, add it and return true. Otherwise, returns false.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:116
Parameters
¶bool doSingleStoreMerge(
SmallVectorImpl<llvm::GStore*>& Stores)
bool doSingleStoreMerge(
SmallVectorImpl<llvm::GStore*>& Stores)
Description
Perform a merge of all the stores in \p Stores into a single store. Erases the old stores from the block when finished.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:129
Parameters
- SmallVectorImpl<llvm::GStore*>& Stores
Returns
true if merging was done. It may fail to perform a merge if there are issues with materializing legal wide values.
¶void getAnalysisUsage(
llvm::AnalysisUsage& AU) const
void getAnalysisUsage(
llvm::AnalysisUsage& AU) const
Description
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:158
Parameters
¶llvm::StringRef getPassName() const
llvm::StringRef getPassName() const
Description
getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:151
¶llvm::MachineFunctionProperties
getRequiredProperties() const
llvm::MachineFunctionProperties
getRequiredProperties() const
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:153
¶void init(llvm::MachineFunction& MF)
void init(llvm::MachineFunction& MF)
Description
Initialize the field members using \p MF.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:80
Parameters
¶void initializeStoreMergeTargetInfo(
unsigned int AddrSpace = 0)
void initializeStoreMergeTargetInfo(
unsigned int AddrSpace = 0)
Description
Initialize some target-specific data structures for the store merging optimization. \p AddrSpace indicates which address space to use when probing the legalizer info for legal stores.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:137
Parameters
- unsigned int AddrSpace = 0
¶bool isLegalOrBeforeLegalizer(
const llvm::LegalityQuery& Query,
llvm::MachineFunction& MF) const
bool isLegalOrBeforeLegalizer(
const llvm::LegalityQuery& Query,
llvm::MachineFunction& MF) const
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:112
Parameters
- const llvm::LegalityQuery& Query
- llvm::MachineFunction& MF
¶bool mergeBlockStores(
llvm::MachineBasicBlock& MBB)
bool mergeBlockStores(
llvm::MachineBasicBlock& MBB)
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:131
Parameters
¶bool mergeFunctionStores(
llvm::MachineFunction& MF)
bool mergeFunctionStores(
llvm::MachineFunction& MF)
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:132
Parameters
¶bool mergeStores(
SmallVectorImpl<llvm::GStore*>& StoresToMerge)
bool mergeStores(
SmallVectorImpl<llvm::GStore*>& StoresToMerge)
Description
Merges the stores in the given vector into a wide store.\p returns true if at least some of the stores were merged. This may decide not to merge stores if heuristics predict it will not be worth it.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:124
Parameters
- SmallVectorImpl<llvm::GStore*>& StoresToMerge
¶bool operationAliasesWithCandidate(
llvm::MachineInstr& MI,
llvm::LoadStoreOpt::StoreMergeCandidate& C)
bool operationAliasesWithCandidate(
llvm::MachineInstr& MI,
llvm::LoadStoreOpt::StoreMergeCandidate& C)
Description
Returns true if the instruction \p MI would potentially alias with any stores in the candidate \p C.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:119
Parameters
¶bool processMergeCandidate(
llvm::LoadStoreOpt::StoreMergeCandidate& C)
bool processMergeCandidate(
llvm::LoadStoreOpt::StoreMergeCandidate& C)
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:130
Parameters
¶bool runOnMachineFunction(
llvm::MachineFunction& MF)
bool runOnMachineFunction(
llvm::MachineFunction& MF)
Description
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Declared at: llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h:160