This is an archive of the discontinued LLVM Phabricator instance.

Add test to check we can instcombine after reassociate. NFC.
ClosedPublic

Authored by rampitec on Oct 21 2021, 11:50 AM.

Details

Summary

The pattern became optimized after b92412fb286b.

Diff Detail

Event Timeline

rampitec requested review of this revision.Oct 21 2021, 11:50 AM
rampitec created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 21 2021, 11:50 AM
spatel accepted this revision.Oct 21 2021, 12:09 PM

LGTM - feel free to add tests without pre-commit review.
I would add the 'or' variant of this pattern too for completeness:

define i32 @not_reassociate_or_or_not(i32 %a, i32 %b, i32 %c, i32 %d) {
  %notb = xor i32 %b, -1
  %notc = xor i32 %c, -1
  %b1 = or i32 %a, %notb
  %b2 = or i32 %b1, %d
  %b3 = or i32 %b2, %notc
  ret i32 %b3
}
llvm/test/Transforms/PhaseOrdering/reassociate-instcombine.ll
4

siplify -> "allow Demorgan logic fold" ?

This revision is now accepted and ready to land.Oct 21 2021, 12:09 PM
rampitec updated this revision to Diff 381360.Oct 21 2021, 12:16 PM
rampitec marked an inline comment as done.

Added second test.

This revision was landed with ongoing or failed builds.Oct 21 2021, 12:27 PM
This revision was automatically updated to reflect the committed changes.