[PATCH] D79641: [AMDGPU] Vectorize alloca thru bitcast
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 8 12:20:25 PDT 2020
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:310
+ V = I->getOperand(0);
+ }
+ return V;
----------------
I think this needs to be careful around multiple uses
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:435
+ for (User *CastUser : Inst->users()) {
+ if (isAssumeLikeIntrinsic(cast<Instruction>(CastUser)))
+ continue;
----------------
Needs test with assume intrinsic
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:481
Value *ExtractElement = Builder.CreateExtractElement(VecValue, Index);
+ if (Inst->getType() != VecEltTy)
+ ExtractElement = Builder.CreateBitCast(ExtractElement, Inst->getType());
----------------
IRBuilder does this check for you so you can omit it
================
Comment at: llvm/test/CodeGen/AMDGPU/vector-alloca-bitcast.ll:28
+ %tmp = alloca [4 x i32], addrspace(5)
+ %x = bitcast [4 x i32] addrspace(5)* %tmp to i32 addrspace(5)*
+ %y = getelementptr [4 x i32], [4 x i32] addrspace(5)* %tmp, i32 0, i32 1
----------------
Needs tests with multiple uses
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79641/new/
https://reviews.llvm.org/D79641
More information about the llvm-commits
mailing list