This is an archive of the discontinued LLVM Phabricator instance.

[BUG][INDVAR] Fix for PR21014: wrong SCEV operands commuting for non-commutative instructions
ClosedPublic

Authored by zinovy.nis on Oct 2 2014, 4:14 AM.

Details

Summary

My commit rL216160 introduced a bug PR21014.

IndVars widens code

for (i = ; i < ...; i++) arr[ CONST - i]

into

for (i = ; i < ...; i++) arr[ i - CONST]

thus inverting index expression. The patch attached fixes it.
Thanks to Jörg Sonnenberger for pointing.

Diff Detail

Repository
rL LLVM

Event Timeline

zinovy.nis updated this revision to Diff 14315.Oct 2 2014, 4:14 AM
zinovy.nis retitled this revision from to [BUG][INDVAR] Fix for PR21014: wrong SCEV operands commuting for non-commutative instructions.
zinovy.nis updated this object.
zinovy.nis edited the test plan for this revision. (Show Details)
zinovy.nis added reviewers: atrick, hfinkel, joerg.
zinovy.nis set the repository for this revision to rL LLVM.
zinovy.nis added a subscriber: Unknown Object (MLST).
hfinkel accepted this revision.Oct 2 2014, 5:44 AM
hfinkel edited edge metadata.

LGTM. (In the future, simple bug fixes like this can be reviewed post-commit).

This revision is now accepted and ready to land.Oct 2 2014, 5:44 AM
zinovy.nis closed this revision.Oct 2 2014, 6:11 AM
zinovy.nis updated this revision to Diff 14322.

Closed by commit rL218867 (authored by @zinovy.nis).