Only handling the constant case right now, and no handling for truncs.
This is only done post-legalization for now. Once the legalizer knows how to decompose these back into shifts, this requirement can probably be removed.
Paths
| Differential D99230
[GlobalISel] Combine G_SEXT_INREG + right shift -> G_SBFX ClosedPublic Authored by paquette on Mar 23 2021, 5:18 PM.
Details Summary Only handling the constant case right now, and no handling for truncs. This is only done post-legalization for now. Once the legalizer knows how to decompose these back into shifts, this requirement can probably be removed.
Diff Detail
Unit TestsFailed Event TimelineThis revision is now accepted and ready to land.Mar 23 2021, 10:03 PM paquette added a child revision: D99283: [GlobalISel] Combine and (lshr x, cst), mask -> ubfx x, cst, width.Mar 24 2021, 10:57 AM Comment Actions I made this AArch64-specific for now. Since G_UBFX/G_SBFX requires custom legalization, the legalization hooks in the CombinerHelper won't work for AArch64. Not sure what the best way to go about fixing that is. Closed by commit rG700431128e21: [GlobalISel][AArch64] Combine G_SEXT_INREG + right shift -> G_SBFX (authored by paquette). · Explain WhyMar 30 2021, 10:26 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 332831 llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/lib/Target/AArch64/AArch64Combine.td
llvm/test/CodeGen/AArch64/GlobalISel/form-bitfield-extract.mir
|
clang-format: please reformat the code