This is an archive of the discontinued LLVM Phabricator instance.

Fix for bug in indvars / SCEV generating wrong code (PR18223)
ClosedPublic

Authored by spatel on May 22 2014, 2:16 PM.

Details

Reviewers
atrick
bogner
Summary

As diagnosed by Justin Bogner in http://llvm.org/bugs/show_bug.cgi?id=18223:
ScalarEvolution::isKnownPredicate() can wrongly reduce a comparison when both the LHS and RHS are SCEVAddRecExprs.

This patch checks that both LHS and RHS are guarded in the case when both are SCEVAddRecExprs.

The test case is against indvars because I could not find a way to directly test SCEV.

Diff Detail

Event Timeline

spatel updated this revision to Diff 9716.May 22 2014, 2:16 PM
spatel retitled this revision from to Fix for bug in indvars / SCEV generating wrong code (PR18223).
spatel updated this object.
spatel edited the test plan for this revision. (Show Details)
spatel added reviewers: atrick, bogner.
atrick edited edge metadata.May 22 2014, 2:18 PM

I'll let Justin review this first since he also has a potential patch. Then I'll review the outcome of that review.

atrick edited edge metadata.May 22 2014, 2:24 PM
atrick added a subscriber: Unknown Object (MLST).
atrick accepted this revision.May 22 2014, 2:41 PM
atrick edited edge metadata.

LGTM

This revision is now accepted and ready to land.May 22 2014, 2:41 PM
spatel closed this revision.Jun 19 2014, 10:09 AM