[PATCH] D102262: [ValueTypes] Rename MVT::getVectorNumElements() to MVT::getVectorMinNumElements(). Fix some misuses of getVectorNumElements()
Fraser Cormack via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 12 08:05:09 PDT 2021
frasercrmck added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:2104
- if (VT.getVectorNumElements() != 1 &&
+ if (!VT.isScalableVector() && VT.getVectorNumElements() != 1 &&
VT.getVectorElementType() != MVT::i1)
----------------
craig.topper wrote:
> frasercrmck wrote:
> > You could probably also express this (and elsewhere) with `!VT.getVectorElementCount().isScalar()` as is done in some other places, but I'm undecided which is better
> Wouldn't !VT.getVectorElementCount().isScalar() be equivalent to (isScalableVector || VT.getVectorNumElements() != 1). I don't think that's what we want here.
Oh yes I was thinking of a case I was dealing with where I *do* want to allow widening for the `vscale x 1` scalable vectors (D102073). I didn't notice that you wanted something different, sorry.
With that in mind -- and maybe it's academic because X86, PPC, Hexagon etc won't encounter scalable types -- perhaps `!isScalar` is more consistent between the scalable types?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102262/new/
https://reviews.llvm.org/D102262
More information about the llvm-commits
mailing list