[PATCH] D110253: [SelectionDAG] Make WidenVecRes_EXTRACT_SUBVECTOR work for scalable vectors.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 08:08:53 PDT 2021


frasercrmck added a comment.

In D110253#3023789 <https://reviews.llvm.org/D110253#3023789>, @sdesmalen wrote:

> In D110253#3023769 <https://reviews.llvm.org/D110253#3023769>, @frasercrmck wrote:
>
>> I'd be interested in seeing some RISCV tests to improve the coverage (but I won't block on it)
>
> I'm happy to add a test, just wasn't entirely sure what types are legal for RVV. Would the same `extract <vscale x 6 x half> from <vscale x 12 x half>` be suitable?

Thanks, yeah that'd need widening. Broadly speaking all power-of-two element counts 1+ are either legal or will need splitting. Anything else will be widened. We don't have `bfloat` though.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:4117
+
+    report_fatal_error("Don't know how to widen the result of "
+                       "EXTRACT_SUBVECTOR for scalable vectors");
----------------
sdesmalen wrote:
> frasercrmck wrote:
> > Nit: is this message too general now? It implies we can't do anything, ever.
> Ah that wasn't my intention, I meant it more as "the code as it is today doesn't know how to widen the result of extract_subvector for scalable vectors". I think the message is correct though, since LLVM doesn't know how to widen it and it avoids falling into the fixed-width code below.
Hmm, from my perspective it's just that this method is `WidenVecRes_EXTRACT_SUBVECTOR` and this patch //is// enabling it to widen the result of extract_subvector for scalable vectors -- at least for those where the part doesn't also need widening. I agree there needs to be a fatal error here, just I thought that a user seeing this error may think something else is going on. I dunno, I may have missed the mark here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110253



More information about the llvm-commits mailing list