[llvm] [GlobalISel] Add support to moreElementsVector for G_SEXT, G_ZEXT and G_ANYEXT (PR #85038)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 05:42:29 PDT 2024


davemgreen wrote:

> > Would it be possible to replace `.maxNumElements()` with `.clampNumElements()` in AArch64LegalizerInfo.cpp? Currently moreElements only gets called by `.moreElementsToNextPow2()` for the EXTEND instructions This might help with legalizing quite a few of the failing EXTEND instructions that has been showing up like: `%1:_(<4 x s16>) = G_ZEXT %0:_(<4 x s8>)`
> 
> Hmm, what would the lower bound be in this case?

The idea would be to (where we can), generally always produce legal types after legalization. Clamp all vector types to 64bit or 128bit, and after legalization only those types would remain, with the intermediate legalization artefacts combined away. So v8i8, v4i16, v2i32 (v1i64 isn't as important in this case).

https://github.com/llvm/llvm-project/pull/85038


More information about the llvm-commits mailing list