LLVM 22.0.0git
|
#include "llvm/Transforms/HipStdPar/HipStdPar.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include <cassert>
#include <string>
#include <utility>
Go to the source code of this file.
Variables | |
static constexpr std::pair< StringLiteral, StringLiteral > | ReplaceMap [] |
static constexpr std::pair< StringLiteral, StringLiteral > | HiddenMap [] |
static constexpr std::pair< StringLiteral, StringLiteral > | MathLibToHipStdPar [] |
|
static |
Definition at line 178 of file HipStdPar.cpp.
References llvm::cast(), llvm::ConstantStruct::get(), llvm::ConstantExpr::getAddrSpaceCast(), getGlobalForName(), getIndirectionGlobal(), llvm::GlobalValue::getParent(), llvm::GlobalValue::getValueType(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by indirectGlobals().
Definition at line 372 of file HipStdPar.cpp.
References llvm::cast(), llvm::DS_Error, F, llvm::CallBase::getArgOperand(), llvm::Instruction::getDebugLoc(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), N, and llvm::StringRef::npos.
|
static |
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().
|
inlinestatic |
Definition at line 118 of file HipStdPar.cpp.
References eraseFromModule().
Referenced by maybeHandleGlobals(), and llvm::HipStdParAcceleratorCodeSelectionPass::run().
|
static |
Definition at line 130 of file HipStdPar.cpp.
References G, llvm::isa(), llvm::transform(), and Uses.
Referenced by indirectGlobals().
Definition at line 73 of file HipStdPar.cpp.
References llvm::PoisonValue::get(), and T.
Referenced by clearModule(), indirectGlobals(), removeUnreachableFunctions(), and llvm::HipStdParAllocationInterpositionPass::run().
|
static |
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().
|
inlinestatic |
Definition at line 147 of file HipStdPar.cpp.
References G, llvm::ConstantDataArray::getString(), N, and llvm::GlobalValue::PrivateLinkage.
Referenced by appendIndirectedGlobal().
|
inlinestatic |
Definition at line 161 of file HipStdPar.cpp.
References llvm::PointerType::get(), llvm::PoisonValue::get(), llvm::GlobalValue::getValueType(), llvm::GlobalValue::PrivateLinkage, llvm::GlobalVariable::setConstant(), llvm::GlobalVariable::setExternallyInitialized(), llvm::GlobalVariable::setInitializer(), and llvm::GlobalValue::setLinkage().
Referenced by appendIndirectedGlobal().
|
static |
Definition at line 289 of file HipStdPar.cpp.
References appendIndirectedGlobal(), collectIndirectableUses(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), eraseFromModule(), fillIndirectionTable(), llvm::for_each(), G, replaceWithIndirectUse(), and Uses.
Referenced by maybeHandleGlobals().
Definition at line 365 of file HipStdPar.cpp.
References llvm::CallingConv::AMDGPU_KERNEL, and F.
Referenced by llvm::HipStdParAcceleratorCodeSelectionPass::run().
|
inlinestatic |
Definition at line 253 of file HipStdPar.cpp.
References llvm::cast(), llvm::LLVMContext::diagnose(), llvm::DS_Error, llvm::Value::getContext(), getNumElements(), llvm::GlobalValue::getValueType(), and llvm::isa().
Referenced by maybeHandleGlobals().
|
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().
|
inlinestatic |
Definition at line 348 of file HipStdPar.cpp.
References llvm::CallingConv::C, llvm::copy_if(), llvm::dyn_cast(), eraseFromModule(), F, llvm::for_each(), llvm::removeFromUsedLists(), and ToRemove.
Referenced by llvm::HipStdParAcceleratorCodeSelectionPass::run().
|
static |
Definition at line 223 of file HipStdPar.cpp.
References assert(), llvm::cast(), llvm::dyn_cast(), G, I, and OpIdx.
Referenced by indirectGlobals().
|
staticconstexpr |
Definition at line 484 of file HipStdPar.cpp.
Referenced by llvm::HipStdParAllocationInterpositionPass::run().
|
staticconstexpr |
Definition at line 534 of file HipStdPar.cpp.
Referenced by llvm::HipStdParMathFixupPass::run().
|
staticconstexpr |
Definition at line 442 of file HipStdPar.cpp.
Referenced by llvm::HipStdParAllocationInterpositionPass::run().