Only do this post-legalization for now
This is generic now.
Paths
| Differential D99283
[GlobalISel] Combine and (lshr x, cst), mask -> ubfx x, cst, width ClosedPublic Authored by paquette on Mar 24 2021, 10:56 AM.
Details Summary
This is generic now.
Diff Detail
Event Timelinepaquette added a parent revision: D99230: [GlobalISel] Combine G_SEXT_INREG + right shift -> G_SBFX.Mar 24 2021, 10:57 AM Comment Actions Rebase + move to AArch64-only to match the G_SBFX combine. Maybe this can be cannibalized into something more generic.
Comment Actions
(Maybe there should be a m_UICst(...) matcher or something...?)
Comment Actions LGTM
This revision is now accepted and ready to land.May 29 2021, 3:56 PM Closed by commit rGe7f501b5e7db: [GlobalISel][AArch64] Combine and (lshr x, cst), mask -> ubfx x, cst, width (authored by paquette). · Explain WhyJun 1 2021, 11:02 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 349026 llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/lib/Target/AArch64/AArch64Combine.td
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/GlobalISel/form-bitfield-extract-from-and.mir
|
The amounts could be a different type from the value, so I guess I'll need to fix that in the instruction definition