This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Reassociate Add with Or
ClosedPublic

Authored by dmgreen on Jun 23 2021, 12:55 AM.

Details

Summary

We already have reassociation code for Adds and Ors separately in DAG combiner, this adds it for the combination of the two where Ors act like Adds. It reassociates (add (or (x, c), y) -> (add (add (x, y), c)) where we know that the Ors operands have no common bits set, and the Or has one use.

Diff Detail

Event Timeline

dmgreen created this revision.Jun 23 2021, 12:55 AM
dmgreen requested review of this revision.Jun 23 2021, 12:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2021, 12:55 AM

Makes sense to me - adding some Hexagon + SystemZ reviewer coverage

Makes sense to me as well. The SystemZ changes are fine.

spatel accepted this revision.Jul 6 2021, 7:21 AM

LGTM.
I'm not sure if we have x86 tests that mimic the ARM diffs here, but I tried those locally, and I see no difference (probably because we have all of those patterns covered in pre-ISEL or ISEL logic that forms LEA).

This revision is now accepted and ready to land.Jul 6 2021, 7:21 AM
This revision was landed with ongoing or failed builds.Jul 7 2021, 2:21 AM
This revision was automatically updated to reflect the committed changes.