- Fix CombinerHelper::matchBitfieldExtractFromAnd to check legality with the correct types for the G_UBFX that it builds.
- 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.
- Add AMDGPU tests where the post-legalizer combiner would create illegal MIR without the above fixes.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Further cleanups are possible:
- Change CombinerHelper::matchBitfieldExtractFromShrAnd to use getPreferredShiftAmountTy for the shift-amount-like operands of G_UBFX, like all the other G_*BFX combines do. Change AArch64's G_*BFX legality rules to match.
- Remove isConstantUnsignedBitfieldExtractLegal since it doesn't seem to do any more than a standard legality check.