diff options
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp index 6fb507083cef1..b09e92c07f9ba 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "AMDGPU.h" +#include "Utils/AMDGPUBaseInfo.h" #include "llvm/ADT/SetVector.h" #include "llvm/Analysis/LegacyDivergenceAnalysis.h" #include "llvm/Analysis/LoopInfo.h" @@ -35,7 +36,7 @@ class AMDGPUAnnotateUniformValues : public FunctionPass, MemoryDependenceResults *MDR; LoopInfo *LI; DenseMap<Value*, GetElementPtrInst*> noClobberClones; - bool isKernelFunc; + bool isEntryFunc; public: static char ID; @@ -127,11 +128,10 @@ void AMDGPUAnnotateUniformValues::visitLoadInst(LoadInst &I) { auto isGlobalLoad = [&](LoadInst &Load)->bool { return Load.getPointerAddressSpace() == AMDGPUAS::GLOBAL_ADDRESS; }; - // We're tracking up to the Function boundaries - // We cannot go beyond because of FunctionPass restrictions - // Thus we can ensure that memory not clobbered for memory - // operations that live in kernel only. - bool NotClobbered = isKernelFunc && !isClobberedInFunction(&I); + // We're tracking up to the Function boundaries, and cannot go beyond because + // of FunctionPass restrictions. We can ensure that is memory not clobbered + // for memory operations that are live in to entry points only. + bool NotClobbered = isEntryFunc && !isClobberedInFunction(&I); Instruction *PtrI = dyn_cast<Instruction>(Ptr); if (!PtrI && NotClobbered && isGlobalLoad(I)) { if (isa<Argument>(Ptr) || isa<GlobalValue>(Ptr)) { @@ -170,7 +170,7 @@ bool AMDGPUAnnotateUniformValues::runOnFunction(Function &F) { DA = &getAnalysis<LegacyDivergenceAnalysis>(); MDR = &getAnalysis<MemoryDependenceWrapperPass>().getMemDep(); LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); - isKernelFunc = F.getCallingConv() == CallingConv::AMDGPU_KERNEL; + isEntryFunc = AMDGPU::isEntryFunctionCC(F.getCallingConv()); visit(F); noClobberClones.clear(); |