[PATCH] D116802: [GlobalISel] Fix legality checks for G_UBFX combines

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 04:07:55 PST 2022


foad created this revision.
foad added reviewers: bcahoon, aemerson, arsenm, paquette.
Herald added subscribers: kerbowa, hiraditya, tpr, rovka, nhaehnle, jvesely.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

1. Fix CombinerHelper::matchBitfieldExtractFromAnd to check legality with the correct types for the G_UBFX that it builds.
2. Fix AMDGPUTargetLowering::isConstantUnsignedBitfieldExtractLegal to match the legality rules: result and first operand can be s32 or s64 but the "shift amount" operands are always s32.
3. Add AMDGPU tests where the post-legalizer combiner would create illegal MIR without the above fixes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116802

Files:
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-ubfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/ubfx.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116802.398097.patch
Type: text/x-patch
Size: 6020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220107/db23f512/attachment.bin>


More information about the llvm-commits mailing list