This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Remove TargetLowering::isConstantUnsignedBitfieldExtractLegal
ClosedPublic

Authored by foad on Jan 7 2022, 6:29 AM.

Details

Diff Detail

Event Timeline

foad created this revision.Jan 7 2022, 6:29 AM
foad requested review of this revision.Jan 7 2022, 6:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2022, 6:29 AM
foad added a comment.Jan 7 2022, 6:31 AM

TBH I don't understand why D99283 introduced this target lowering hook in the first place. Comments on the review say "The annoying part (for AArch64) is that the legality checks don't work with custom legalization". Did isLegalOrCustom not exist back then? Or does it not do the right thing? (I don't see any tests failing with this patch.)

arsenm added a comment.Jan 7 2022, 7:41 AM

Legality rules can't be context dependent on the specific operands used, but IIRC here it only wants to use it if the operands are constants

foad added a comment.Jan 7 2022, 8:05 AM

Legality rules can't be context dependent on the specific operands used, but IIRC here it only wants to use it if the operands are constants

Well in practice the implementations of isConstantUnsignedBitfieldExtractLegal did exactly the same as the legal-or-custom check anyway, so it still seems redundant.

arsenm accepted this revision.Aug 18 2023, 6:33 AM

LGTM. The handle constant cases better should probably be optimization combines

This revision is now accepted and ready to land.Aug 18 2023, 6:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2023, 6:33 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
This revision was landed with ongoing or failed builds.Sep 27 2023, 8:11 AM
This revision was automatically updated to reflect the committed changes.