This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add simple DAG combine to pull xor with 1 through select_cc.
ClosedPublic

Authored by craig.topper on Jul 24 2023, 10:23 AM.

Details

Summary

If we're selecting the result of two setccs that have been legalized
by introducing an xor with 1, we can pull the xor with 1 through the
select to enable more optimizations.

We could generalize this to other binary operators with identical
conditions, but those are usually caught before we legalize the select.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 24 2023, 10:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 10:23 AM
craig.topper requested review of this revision.Jul 24 2023, 10:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 10:23 AM
Herald added subscribers: eopXD, MaskRay. · View Herald Transcript
asb accepted this revision.Jul 25 2023, 6:01 AM

LGTM.

This revision is now accepted and ready to land.Jul 25 2023, 6:01 AM
This revision was landed with ongoing or failed builds.Jul 25 2023, 9:03 AM
This revision was automatically updated to reflect the committed changes.