This is an archive of the discontinued LLVM Phabricator instance.

[IRCE] isKnownNonNegative helper
ClosedPublic

Authored by samparker on Apr 10 2018, 3:19 AM.

Details

Summary

Breaking out the isKnownNonNegative helper function from D45439. The reason why isKnownNegative was seemingly eeded was because I was using the UGE predicate as well as SGE...

Diff Detail

Repository
rL LLVM

Event Timeline

samparker created this revision.Apr 10 2018, 3:19 AM

Code part is fine (with a nit inline). Do you have a test for which this change enabled IRCE? If yes, please add.

lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
809 ↗(On Diff #141817)

You can use SE.getZero(BoundSCEV->getType()).

mkazantsev accepted this revision.Apr 10 2018, 3:26 AM
mkazantsev added inline comments.
lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
807 ↗(On Diff #141817)

How about isKnownNonNegativeInLoop?

This revision is now accepted and ready to land.Apr 10 2018, 3:26 AM

LGTM after you address the nits; if there is a test which shows that IRCE now works where it didn't, I highly encourage you to add it. But even if not, this change is obviously profitable.

This revision was automatically updated to reflect the committed changes.