[AArch64][GlobalISel] Overhaul G_EXTRACT legalization
authorJessica Paquette <jpaquette@apple.com>
Wed, 4 Aug 2021 20:29:27 +0000 (13:29 -0700)
committerJessica Paquette <jpaquette@apple.com>
Thu, 5 Aug 2021 20:55:15 +0000 (13:55 -0700)
commit51bd4e874fa51412e7399fe7f863169b4f4829bc
treeeff6e1db8a39b4b9fe593cb0e83a6ab6ee5a54c1
parentc2a3fb303f1fffeb0856863cc5eff1529e1db5e7
[AArch64][GlobalISel] Overhaul G_EXTRACT legalization

This simplifies our existing G_EXTRACT rules and adds some test coverage. Mostly
changing this because it should make it easier to improve legalization for
instructions which use G_EXTRACT as part of the legalization process.

This also adds support for legalizing some weird types. Similar to other recent
legalizer changes, this changes the order of widening/clamping.

There was some dead code in our existing rules (e.g. the p0 case would never get
hit), so this knocks those out and makes the types we want to handle explicit.

This also removes some checks which, nowadays, are handled by the
MachineVerifier.

Differential Revision: https://reviews.llvm.org/D107505
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-combines.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-extracts.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-inserts.mir