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

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 05:24:17 PDT 2020


sdesmalen added inline comments.


================
Comment at: llvm/lib/IR/Type.cpp:161
 
+bool Type::isScalableVectorTy() const {
+  return getTypeID() == VectorTyID && getVectorIsScalable();
----------------
Can this be inlined in llvm/include/llvm/IR/Type.h ?


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:4475
+      AI.getAllocatedType()->isScalableVectorTy() ||
+      DL.getTypeAllocSize(AI.getAllocatedType()).getFixedSize() == 0)
     return false;
----------------
If you base your patch on D76748, you can use `DL.getTypeAllocSize(AI.getAllocatedType()).isZero()`.


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

https://reviews.llvm.org/D76720





More information about the llvm-commits mailing list