[PATCH] D31710: [AMDGPU] Fix for issue in alloca to vector promotion pass

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 14:05:38 PDT 2017


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:405-407
+    // Canonical form means that the pointer should be a GEP
+    LoadInst *LI = cast<LoadInst>(Inst);
+    return isa<GetElementPtrInst>(LI->getPointerOperand());
----------------
This isn't necessarily true. You could have a direct store to an alloca pointer for example


================
Comment at: lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:432
       AllocaTy->getElementType()->isVectorTy() ||
+      AllocaTy->getElementType()->isArrayTy() ||
       AllocaTy->getNumElements() > 4 ||
----------------
I can see how this would be a problem and not handled today, but I don't think anything flatten array types. You could still see something like [4 x [4 x i32]], though the elements will still be individually addressed, not as aggregate loads and stores


https://reviews.llvm.org/D31710





More information about the llvm-commits mailing list