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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 14:07:08 PDT 2020


efriedma 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())
----------------
c-rhodes wrote:
> 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?
If it's easy, might as well handle it here, if there's some non-obvious complication, I'd be fine with putting it off.


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

https://reviews.llvm.org/D75672





More information about the llvm-commits mailing list