diff options
| author | Changpeng Fang <changpeng.fang@gmail.com> | 2017-05-12 20:31:12 +0000 |
|---|---|---|
| committer | Changpeng Fang <changpeng.fang@gmail.com> | 2017-05-12 20:31:12 +0000 |
| commit | 161e8c39af4b7ff6ddce76ffe7aa78fc1f35583f (patch) | |
| tree | 83d18d2e3a67ef79e59f203b027b4be2211e8030 /llvm/lib | |
| parent | a1978aaefd3adc7675e1efbff9f907cd4318e624 (diff) | |
| download | bcm5719-llvm-161e8c39af4b7ff6ddce76ffe7aa78fc1f35583f.tar.gz bcm5719-llvm-161e8c39af4b7ff6ddce76ffe7aa78fc1f35583f.zip | |
AMDGPU/SI: Don't promote to vector if the load/store is volatile.
Summary:
We should not change volatile loads/stores in promoting alloca to vector.
Reviewers:
arsenm
Differential Revision:
http://reviews.llvm.org/D33107
llvm-svn: 302943
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp index 36dcc699d4e..e40f3955774 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp @@ -397,14 +397,17 @@ static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { // instructions. static bool canVectorizeInst(Instruction *Inst, User *User) { switch (Inst->getOpcode()) { - case Instruction::Load: + case Instruction::Load: { + LoadInst *LI = cast<LoadInst>(Inst); + return !LI->isVolatile(); + } case Instruction::BitCast: case Instruction::AddrSpaceCast: return true; case Instruction::Store: { // Must be the stored pointer operand, not a stored value. StoreInst *SI = cast<StoreInst>(Inst); - return SI->getPointerOperand() == User; + return (SI->getPointerOperand() == User) && !SI->isVolatile(); } default: return false; |

