diff options
author | Changpeng Fang <changpeng.fang@gmail.com> | 2018-05-17 21:49:44 +0000 |
---|---|---|
committer | Changpeng Fang <changpeng.fang@gmail.com> | 2018-05-17 21:49:44 +0000 |
commit | 860d46006333d9b6a1021035c730f9f72800d51e (patch) | |
tree | b59a2ff0712d3c29e2d40fc92db70a64f0d6ee21 /llvm/lib/Target/AMDGPU | |
parent | 1de9fce15152a410aa082f4f38d52c41f01fece1 (diff) | |
download | bcm5719-llvm-860d46006333d9b6a1021035c730f9f72800d51e.tar.gz bcm5719-llvm-860d46006333d9b6a1021035c730f9f72800d51e.zip |
AMDGPU/SI: Don't promote alloca to vector for atomic load/store
Summary:
Don't promote alloca to vector for atomic load/store
Reviewer:
arsenm
Differential Revision:
https://reviews.llvm.org/D46085
llvm-svn: 332673
Diffstat (limited to 'llvm/lib/Target/AMDGPU')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp index 9264cb11fb8..2f83e606047 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp @@ -323,17 +323,19 @@ static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { static bool canVectorizeInst(Instruction *Inst, User *User) { switch (Inst->getOpcode()) { case Instruction::Load: { + // Currently only handle the case where the Pointer Operand is a GEP. + // Also we could not vectorize volatile or atomic loads. LoadInst *LI = cast<LoadInst>(Inst); - // Currently only handle the case where the Pointer Operand is a GEP so check for that case. - return isa<GetElementPtrInst>(LI->getPointerOperand()) && !LI->isVolatile(); + return isa<GetElementPtrInst>(LI->getPointerOperand()) && LI->isSimple(); } case Instruction::BitCast: return true; case Instruction::Store: { // Must be the stored pointer operand, not a stored value, plus // since it should be canonical form, the User should be a GEP. + // Also we could not vectorize volatile or atomic stores. StoreInst *SI = cast<StoreInst>(Inst); - return (SI->getPointerOperand() == User) && isa<GetElementPtrInst>(User) && !SI->isVolatile(); + return (SI->getPointerOperand() == User) && isa<GetElementPtrInst>(User) && SI->isSimple(); } default: return false; |