[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 07:37:10 PDT 2020


c-rhodes added inline comments.


================
Comment at: llvm/lib/IR/Type.cpp:161
 
+bool Type::isScalableVectorTy() const {
+  return getTypeID() == VectorTyID && getVectorIsScalable();
----------------
sdesmalen wrote:
> Can this be inlined in llvm/include/llvm/IR/Type.h ?
Hm I'm not sure, is there a reason other methods like `isVectorTy` aren't defined with inline in Type.h?


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:4475
+      AI.getAllocatedType()->isScalableVectorTy() ||
+      DL.getTypeAllocSize(AI.getAllocatedType()).getFixedSize() == 0)
     return false;
----------------
sdesmalen wrote:
> If you base your patch on D76748, you can use `DL.getTypeAllocSize(AI.getAllocatedType()).isZero()`.
Ah nice, thanks for pointing that out I'll update this.


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

https://reviews.llvm.org/D76720





More information about the llvm-commits mailing list