This is an archive of the discontinued LLVM Phabricator instance.

[ScalarEvolution] Fix PR24757.
ClosedPublic

Authored by sanjoy on Sep 9 2015, 2:29 AM.

Details

Summary

PR24757 was caused by some incorect math in
ScalarEvolution::HowFarToZero -- the smallest unsigned solution for X
in

2^N * A = 2^N * X

is not necessarily A.

Diff Detail

Event Timeline

sanjoy updated this revision to Diff 34303.Sep 9 2015, 2:29 AM
sanjoy retitled this revision from to [ScalarEvolution] Fix PR24757..
sanjoy updated this object.
sanjoy added reviewers: atrick, majnemer, meheff.
sanjoy added a subscriber: llvm-commits.
atrick accepted this revision.Sep 9 2015, 9:31 PM
atrick edited edge metadata.

LGTM. I can't argue with the math. However, it would help intuitively if you provide one example of concrete values for distance and step that break the current code, in addition to your symbolic proof.

This revision is now accepted and ready to land.Sep 9 2015, 9:31 PM
sanjoy updated this revision to Diff 34411.Sep 9 2015, 10:26 PM
sanjoy edited edge metadata.
  • address Andy's review: add more comments. No functional change in this update.
This revision was automatically updated to reflect the committed changes.
meheff edited edge metadata.Sep 9 2015, 11:26 PM

LGTM. Good catch!