This is an archive of the discontinued LLVM Phabricator instance.

[ConstraintElimination] Add tests to check for `or` instruction decomposition if a constant operand is < 2^known_zero_bits of the first operand.
ClosedPublic

Authored by zjaffal on Jan 25 2023, 7:39 AM.

Diff Detail

Event Timeline

zjaffal created this revision.Jan 25 2023, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2023, 7:39 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
zjaffal requested review of this revision.Jan 25 2023, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2023, 7:39 AM
fhahn added inline comments.Jan 26 2023, 4:26 AM
llvm/test/Transforms/ConstraintElimination/or.ll
435

The names need updating I think to be more descriptive? There's just a single condition here and it would be good to make clear this tests or -> add conversion.

467

Maybe call the blocks just then and else?

Also, it would be good to add some checks in this block too, to make sure they don't get optimized.

fhahn requested changes to this revision.Feb 6 2023, 2:20 PM

Looks like this patch needs updating.

This revision now requires changes to proceed.Feb 6 2023, 2:20 PM
zjaffal updated this revision to Diff 496140.Feb 9 2023, 8:22 AM
  1. Update test names
  2. Add additional negative testcases
fhahn accepted this revision.Feb 20 2023, 5:32 AM

LGTM, with the suggested additional cleanup

llvm/test/Transforms/ConstraintElimination/or.ll
471

Could you rename this variable? maybe %start.plus.3?

also, remove the dead %low argument.

This revision is now accepted and ready to land.Feb 20 2023, 5:32 AM
zjaffal marked 3 inline comments as done.Feb 20 2023, 6:09 AM
This revision was landed with ongoing or failed builds.Feb 20 2023, 6:39 AM
This revision was automatically updated to reflect the committed changes.