summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
index 1b3ce61ef92..b7d30d235a0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
@@ -125,14 +125,16 @@ bool AMDGPUPromoteAlloca::runOnFunction(Function &F) {
if (GV.getType()->getAddressSpace() != AMDGPUAS::LOCAL_ADDRESS)
continue;
- for (Use &U : GV.uses()) {
+ for (User *U : GV.users()) {
Instruction *Use = dyn_cast<Instruction>(U);
if (!Use)
continue;
- if (Use->getParent()->getParent() == &F)
+ if (Use->getParent()->getParent() == &F) {
LocalMemAvailable -=
Mod->getDataLayout().getTypeAllocSize(GV.getValueType());
+ break;
+ }
}
}
OpenPOWER on IntegriCloud