[llvm] [AArch64][GlobalISel] Expand abs.v4i8 to v4i16 and abs.v2s16 to v2s32 (PR #81231)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 21:42:17 PST 2024


https://github.com/aemerson approved this pull request.

I think we should try to stick with extending elements because the legalizer's overall strategy is to rely on extending/truncating artifact operations to be eliminated. In that respect, vectors aren't too different from scalars, the overall type is too narrow for the operation to natively support, and therefore we perform the operation at the wider type and truncate back down to the original width. If the user instruction of that value also doesn't support that narrow type, it extends it and both truncate and extend are eliminated by the artifact combiner.

While this folding away can also be done for moreElements/fewerElements, if we start doing vector promotion we lose this symmetry of truncate/extend for both scalars and vectors. If there's serious problems with this approach that we can't mitigate then I'm open to changing my mind, but for now I agree with this change.

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


More information about the llvm-commits mailing list