diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
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(); |