LLVM: lib/Transforms/HipStdPar/HipStdPar.cpp File Reference (original) (raw)

Go to the source code of this file.

Functions
template<typename T>
static void eraseFromModule (T &ToErase)
static bool checkIfSupported (GlobalVariable &G)
static void clearModule (Module &M)
static SmallVector< std::reference_wrapper< Use > > collectIndirectableUses (GlobalVariable *G)
static GlobalVariable * getGlobalForName (GlobalVariable *G)
static GlobalVariable * getIndirectionGlobal (Module *M)
static Constant * appendIndirectedGlobal (const GlobalVariable *IndirectionTable, SmallVector< Constant * > &SymbolIndirections, GlobalVariable *ToIndirect)
static void fillIndirectionTable (GlobalVariable *IndirectionTable, SmallVector< Constant * > Indirections)
static void replaceWithIndirectUse (const Use &U, const GlobalVariable *G, Constant *IndirectedG)
static bool isValidIndirectionTable (GlobalVariable *IndirectionTable)
static void indirectGlobals (GlobalVariable *IndirectionTable, SmallVector< GlobalVariable * > ToIndirect)
static void maybeHandleGlobals (Module &M)
template<unsigned N>
static void removeUnreachableFunctions (const SmallPtrSet< const Function *, N > &Reachable, Module &M)
static bool isAcceleratorExecutionRoot (const Function *F)
static bool checkIfSupported (const Function *F, const CallBase *CB)

appendIndirectedGlobal()

checkIfSupported() [1/2]

checkIfSupported() [2/2]

Definition at line 78 of file HipStdPar.cpp.

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::cast(), llvm::DS_Error, llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), G, I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SmallVectorImpl< T >::insert(), llvm::isa(), and llvm::SmallVectorTemplateBase< T, bool >::pop_back().

Referenced by maybeHandleGlobals(), and llvm::HipStdParAcceleratorCodeSelectionPass::run().

clearModule()

void clearModule ( Module & M) inlinestatic

collectIndirectableUses()

eraseFromModule()

template<typename T>

void eraseFromModule ( T & ToErase) inlinestatic

fillIndirectionTable()

Definition at line 198 of file HipStdPar.cpp.

References llvm::cast(), llvm::Count, llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::ConstantStruct::get(), llvm::PoisonValue::get(), llvm::ConstantExpr::getAddrSpaceCast(), llvm::GlobalValue::getParent(), llvm::Type::getStructElementType(), llvm::GlobalValue::getValueType(), llvm::GlobalValue::PrivateLinkage, llvm::GlobalVariable::setInitializer(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by indirectGlobals().

getGlobalForName()

getIndirectionGlobal()

indirectGlobals()

isAcceleratorExecutionRoot()

isValidIndirectionTable()

maybeHandleGlobals()

void maybeHandleGlobals ( Module & M) inlinestatic

Definition at line 316 of file HipStdPar.cpp.

References checkIfSupported(), clearModule(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), G, llvm::PoisonValue::get(), indirectGlobals(), isValidIndirectionTable(), IT, and llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by llvm::HipStdParAcceleratorCodeSelectionPass::run().

removeUnreachableFunctions()

replaceWithIndirectUse()

HiddenMap

Initial value:

{

{"__hipstdpar_hidden_malloc", "__libc_malloc"},

{"__hipstdpar_hidden_free", "__libc_free"},

{"__hipstdpar_hidden_memalign", "__libc_memalign"},

{"__hipstdpar_hidden_mmap", "mmap"},

{"__hipstdpar_hidden_munmap", "munmap"}}

Definition at line 484 of file HipStdPar.cpp.

Referenced by llvm::HipStdParAllocationInterpositionPass::run().

MathLibToHipStdPar

ReplaceMap