[PATCH] D75672: [ValueTypes] Add support for scalable EVTs

Cullen Rhodes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 05:13:55 PDT 2020


c-rhodes added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/ValueTypes.h:265
     unsigned getVectorNumElements() const {
-      assert(isVector() && "Invalid vector type!");
+      assert((isVector() || isScalableVector()) && "Invalid vector type!");
       if (isSimple())
----------------
efriedma wrote:
> c-rhodes wrote:
> > efriedma wrote:
> > > Not sure changing getVectorNumElements like this makes sense.
> > I've removed this change, there was just one place in SelectionDAGBuilder I had to fix up to call `getVectorElementCount`. I had a chat with Graham and he suggested it would be good to check if it's a fixed-length vector here, maybe by having something similar to the MVT `isFixedLengthVector` on the EVT which could call `MVT::isFixedLengthVector` if it's a `SimplyTy` or check it's not a scalable vector otherwise.
> Yes, we want to catch incorrect use of getNumElements in both IR and in SelectionDAG.
Is this something we can implement going forward or should this be handled before landing this patch?


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

https://reviews.llvm.org/D75672





More information about the llvm-commits mailing list