diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-05-18 23:20:24 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-05-18 23:20:24 +0000 |
| commit | c438ef574df3fd4ecd1ce8d534bcff95a29756bb (patch) | |
| tree | fd41a64d682704fa0b040440364ea14eb37cbe86 /llvm/lib/Target | |
| parent | 52bbde2bbce0dedee49429b30018f81e024c2db2 (diff) | |
| download | bcm5719-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.cpp | 10 |
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; |

