This implements walking over G_ASHR in the same way as getTestBitOperand in AArch64ISelLowering.
(tbz (ashr x, c), b) -> (tbz x, b+c) or (tbz x, msb) if b+c is > # bits in x
Paths
| Differential D73933
[AArch64][GlobalISel] Fold G_ASHR into TB(N)Z bit calculation ClosedPublic Authored by paquette on Feb 3 2020, 3:15 PM.
Details Summary This implements walking over G_ASHR in the same way as getTestBitOperand in AArch64ISelLowering. (tbz (ashr x, c), b) -> (tbz x, b+c) or (tbz x, msb) if b+c is > # bits in x
Diff Detail Event TimelineHerald added subscribers: Petar.Avramovic, hiraditya, kristof.beyls, rovka. · View Herald Transcript Comment Actions LGTM with nit.
This revision is now accepted and ready to land.Feb 5 2020, 9:53 AM Closed by commit rG292f7257118a: [AArch64][GlobalISel] Fold G_ASHR into TB(N)Z bit calculation (authored by paquette). · Explain WhyFeb 5 2020, 10:05 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 242210 llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-shift-tbz-tbnz.mir
|
Can you factor our these getType() calls here and in the G_SHL case into a variable?