[PATCH] D45228: AMDGPU/SI: Handle BitCast of GEP in promoting alloca to vector

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 14:50:55 PDT 2018


cfang marked 8 inline comments as done.
cfang added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:330
     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();
+    if (LI->isVolatile())
+      return false;
----------------
arsenm wrote:
> I think there's another bug here (which should be fixed in a separate patch). This probably also needs to check if it's atomic
Done in a separate patch under review.


================
Comment at: lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:354
   case Instruction::AddrSpaceCast:
     return true;
   case Instruction::Store: {
----------------
arsenm wrote:
> This looks broken. addrspacecast should forbid the vector promotion. It should only be allowed for the LDS promotion. Separate patch?
Done in a separate patch under review.


https://reviews.llvm.org/D45228





More information about the llvm-commits mailing list