This is an archive of the discontinued LLVM Phabricator instance.

Move folding of icmp with zero after checking for min/max idioms.
ClosedPublic

Authored by ArturGainullin on Oct 15 2017, 3:26 AM.

Details

Summary

The following transformation for cmp instruction:

icmp smin(x, PositiveValue), 0 -> icmp x, 0

should only be done after checking for min/max to prevent infinite
looping caused by a reverse canonicalization. That is why this
transformation was moved to place after the mentioned check.

Diff Detail

Repository
rL LLVM

Event Timeline

ArturGainullin created this revision.Oct 15 2017, 3:26 AM

Fixed comment.

spatel accepted this revision.Oct 15 2017, 7:04 AM

LGTM.

Do you have commit access?

This revision is now accepted and ready to land.Oct 15 2017, 7:04 AM
This revision was automatically updated to reflect the committed changes.

Sanjay, no, I don't have. I have asked my colleague to commit. Thanks!