[llvm] 0dcc8b8 - [AMDGPU] AMDGPUAnnotateUniformValues: inline a single-use lambda. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 31 03:22:30 PST 2022
Author: Jay Foad
Date: 2022-01-31T11:22:09Z
New Revision: 0dcc8b86ee3819d4e0d01a3084926a182eee6981
URL: https://github.com/llvm/llvm-project/commit/0dcc8b86ee3819d4e0d01a3084926a182eee6981
DIFF: https://github.com/llvm/llvm-project/commit/0dcc8b86ee3819d4e0d01a3084926a182eee6981.diff
LOG: [AMDGPU] AMDGPUAnnotateUniformValues: inline a single-use lambda. NFC.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
index 7d6845b287bc7..00ae8f027a13d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
@@ -84,9 +84,6 @@ void AMDGPUAnnotateUniformValues::visitLoadInst(LoadInst &I) {
Value *Ptr = I.getPointerOperand();
if (!DA->isUniform(Ptr))
return;
- auto isGlobalLoad = [&](LoadInst &Load)->bool {
- return Load.getPointerAddressSpace() == AMDGPUAS::GLOBAL_ADDRESS;
- };
// 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.
@@ -99,7 +96,7 @@ void AMDGPUAnnotateUniformValues::visitLoadInst(LoadInst &I) {
}
bool NotClobbered = false;
- bool GlobalLoad = isGlobalLoad(I);
+ bool GlobalLoad = I.getPointerAddressSpace() == AMDGPUAS::GLOBAL_ADDRESS;
if (PtrI)
NotClobbered = GlobalLoad && !isClobberedInFunction(&I);
else if (isa<Argument>(Ptr) || isa<GlobalValue>(Ptr)) {
More information about the llvm-commits
mailing list