[AArch64][GlobalISel] Mark some vector G_ABS cases as legal
authorJessica Paquette <jpaquette@apple.com>
Wed, 21 Apr 2021 00:48:17 +0000 (17:48 -0700)
committerJessica Paquette <jpaquette@apple.com>
Thu, 22 Apr 2021 01:10:40 +0000 (18:10 -0700)
commit6cb7599078121f1e510b27170815f81f169c9554
tree6f8c11a50a9b6fef1f1ae54530e11d35358a2900
parent1a719089a81b418b480e8b08d2d971fb087860db
[AArch64][GlobalISel] Mark some vector G_ABS cases as legal

Each of the cases marked as legal here have an imported pattern in
AArch64GenGlobalISel.inc. So, if we mark them as legal, we get selection for
free.

Technically this is only supposed to happen if we have NEON support. But, we
fall back if we don't have that in the legalizer right now. I suppose it'd be
better to have a FIXME so we can write the testcase when the time comes.

(Plus, it'd just fall back in selection if NEON isn't available, so it's not
*wrong*, I guess?)

This fixes some fallbacks in the test suite.

(Also use `isScalar` from LegalityPredicates.cpp while we're here just to tidy
things a little bit.)

Differential Revision: https://reviews.llvm.org/D100916
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-abs.mir
llvm/test/CodeGen/AArch64/GlobalISel/select-abs.mir [new file with mode: 0644]