[PATCH] D79416: [SVE] Fix wrong usage of getNumElements() in matchIntrinsicType

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 14:03:44 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/IR/Function.cpp:1184
+      // TODO: It would be nice if we could assert that we'd seen
+      // a ScalableVecArgument prior to this for ScalableVectorTypes
       VectorType *VT = dyn_cast<VectorType>(Ty);
----------------
I don't think we should allow a ScalableVectorType here.  Instead, I think we should fix the recursive call to matchIntrinsicType for IITDescriptor::ScalableVecArgument to pass down an appropriate FixedVectorType, and then `dyn_cast<FixedVectorType>(Ty)` here.

Yes, that's a little weird, but better to make the weirdness self-consistent; my suggestion is consistent with the way we handle ScalableVecArgument in other places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79416





More information about the llvm-commits mailing list