#include "AMDGPU.h"
#include "AMDGPUMemoryUtils.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemorySSA.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/InitializePasses.h"
#define DEBUG_TYPE …
usingnamespacellvm;
namespace {
class AMDGPUPromoteKernelArguments : public FunctionPass { … };
}
void AMDGPUPromoteKernelArguments::enqueueUsers(Value *Ptr) { … }
bool AMDGPUPromoteKernelArguments::promotePointer(Value *Ptr) { … }
bool AMDGPUPromoteKernelArguments::promoteLoad(LoadInst *LI) { … }
static BasicBlock::iterator getInsertPt(BasicBlock &BB) { … }
bool AMDGPUPromoteKernelArguments::run(Function &F, MemorySSA &MSSA,
AliasAnalysis &AA) { … }
bool AMDGPUPromoteKernelArguments::runOnFunction(Function &F) { … }
INITIALIZE_PASS_BEGIN(AMDGPUPromoteKernelArguments, DEBUG_TYPE,
"AMDGPU Promote Kernel Arguments", false, false)
INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
INITIALIZE_PASS_END(AMDGPUPromoteKernelArguments, DEBUG_TYPE,
"AMDGPU Promote Kernel Arguments", false, false)
char AMDGPUPromoteKernelArguments::ID = …;
FunctionPass *llvm::createAMDGPUPromoteKernelArgumentsPass() { … }
PreservedAnalyses
AMDGPUPromoteKernelArgumentsPass::run(Function &F,
FunctionAnalysisManager &AM) { … }