This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Refactor and/or of icmp with constant (NFCI)
ClosedPublic

Authored by nikic on Nov 7 2021, 11:51 AM.

Details

Summary

Rather than testing for many specific combinations of predicates and values, compute the exact icmp regions for both comparisons and check whether they union/intersect exactly. If they do, construct the equivalent icmp for the new range. Assuming that the existing code handled all possible cases, this should be NFC.

Diff Detail

Event Timeline

nikic created this revision.Nov 7 2021, 11:51 AM
nikic requested review of this revision.Nov 7 2021, 11:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2021, 11:51 AM
lebedev.ri accepted this revision.Nov 8 2021, 9:44 AM

Presumably you have proved these transformations via brute-force (even though said test coverage isn't being added).

This revision is now accepted and ready to land.Nov 8 2021, 9:44 AM
This revision was landed with ongoing or failed builds.Nov 9 2021, 12:05 PM
This revision was automatically updated to reflect the committed changes.