Page MenuHomePhabricator

[InstSimplify] Simplify comparison between zext(x) and sext(x)

Authored by nikic on Jul 2 2020, 1:30 PM.



This is picking up a loose thread from D69006: We can simplify (zext x) ule (sext x) and (zext x) sge (sext x) to true, with various permutations. Oddly, SCEV knows about this identity, but nothing on the IR level does.

Alive is happy:

Diff Detail

Event Timeline

nikic created this revision.Jul 2 2020, 1:30 PM
spatel accepted this revision.Jul 3 2020, 2:45 PM

LGTM, but you should adjust at least a couple of the tests to use vector types so we have better coverage.

This revision is now accepted and ready to land.Jul 3 2020, 2:45 PM
This revision was automatically updated to reflect the committed changes.