[PATCH] D76720: [Transforms][SROA] Promote allocas with mem2reg for scalable types

Cullen Rhodes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 13:43:18 PDT 2020


c-rhodes added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:4599
+          cast<VectorType>(AI->getAllocatedType())->isScalable() &&
+          isAllocaPromotable(AI))
+        PromotableAllocas.push_back(AI);
----------------
efriedma wrote:
> This looks weird; did you mean to write something like this?
> 
> ```
>     if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) {
>       if (isa<VectorType>(AI->getAllocatedType()) &&
>           cast<VectorType>(AI->getAllocatedType())->isScalable()) {
>         if (isAllocaPromotable(AI))
>           PromotableAllocas.push_back(AI);
>       } else {
>         Worklist.insert(AI);
>       }
>     }
> ```
Oops, yes I did! Good spot, we don't want allocas with scalable types that aren't promotable added to the worklist as `runOnAlloca` will blow up. Cheers, I'll fix this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76720/new/

https://reviews.llvm.org/D76720





More information about the llvm-commits mailing list