summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-05-18 23:20:24 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-05-18 23:20:24 +0000
commitc438ef574df3fd4ecd1ce8d534bcff95a29756bb (patch)
treefd41a64d682704fa0b040440364ea14eb37cbe86 /llvm/lib/Target
parent52bbde2bbce0dedee49429b30018f81e024c2db2 (diff)
downloadbcm5719-llvm-c438ef574df3fd4ecd1ce8d534bcff95a29756bb.tar.gz
bcm5719-llvm-c438ef574df3fd4ecd1ce8d534bcff95a29756bb.zip
AMDGPU: Fix promote alloca for pointer loads
If the load has a pointer type, we don't want to change its type. llvm-svn: 270000
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
index 134ade765eb..5222bed0d25 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
@@ -552,6 +552,13 @@ bool AMDGPUPromoteAlloca::collectUsesWithPtrTypes(
if (UseInst->getOpcode() == Instruction::PtrToInt)
return false;
+ if (LoadInst *LI = dyn_cast_or_null<LoadInst>(UseInst)) {
+ if (LI->isVolatile())
+ return false;
+
+ continue;
+ }
+
if (StoreInst *SI = dyn_cast<StoreInst>(UseInst)) {
if (SI->isVolatile())
return false;
@@ -559,9 +566,6 @@ bool AMDGPUPromoteAlloca::collectUsesWithPtrTypes(
// Reject if the stored value is not the pointer operand.
if (SI->getPointerOperand() != Val)
return false;
- } else if (LoadInst *LI = dyn_cast_or_null<LoadInst>(UseInst)) {
- if (LI->isVolatile())
- return false;
} else if (AtomicRMWInst *RMW = dyn_cast_or_null<AtomicRMWInst>(UseInst)) {
if (RMW->isVolatile())
return false;
OpenPOWER on IntegriCloud