Page MenuHomePhabricator

Teach SCEV normalization to de/normalize non-affine add recs
ClosedPublic

Authored by sanjoy on Apr 14 2017, 5:02 PM.

Details

Summary

Before this change, SCEV Normalization would incorrectly normalize
non-affine add recurrences. To work around this there was (still is)
a check in place to make sure we only tried to normalize affine add
recurrences.

We recently found a bug in aforementioned check to bail out of
normalizing non-affine add recurrences. However, instead of fixing
the bailout, I have decided to teach SCEV normalization to work
correctly with non-affine add recurrences, making the bailout
unnecessary (I'll remove it in a subsequent change).

I've also added some unit tests (which would have failed before this
change).

Diff Detail

Repository
rL LLVM

Event Timeline

sanjoy created this revision.Apr 14 2017, 5:02 PM
atrick accepted this revision.Apr 21 2017, 10:49 AM

Neat. I wouldn't usually add complexity for an unexpected situation, but this is purely a generalization.

This revision is now accepted and ready to land.Apr 21 2017, 10:49 AM

Neat. I wouldn't usually add complexity for an unexpected situation, but this is purely a generalization.

Yes, it does not really matter from a feature perspective, but it means we no longer need to be careful to filter out specific add recurrences from IVUsers et. al.. Speaking of which, can you please also take a look at D32105?

This revision was automatically updated to reflect the committed changes.