This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Be robust against IR generated by simple-loop-unswitch
ClosedPublic

Authored by reames on Nov 19 2019, 1:09 PM.

Details

Summary

Simple loop unswitch likes to leave around unsimplified and/or/xors. SCEV today bails out on these idioms which is unfortunate in general, and specifically for the unswitch interaction.

Diff Detail

Event Timeline

reames created this revision.Nov 19 2019, 1:09 PM
fhahn added a subscriber: fhahn.Nov 19 2019, 2:45 PM
ebrevnov added inline comments.Nov 19 2019, 11:48 PM
llvm/test/Analysis/ScalarEvolution/trip-count-andor.ll
18

I would expect max BE taken count to be %n as well.

reames marked an inline comment as done.Nov 20 2019, 10:57 AM
reames added inline comments.
llvm/test/Analysis/ScalarEvolution/trip-count-andor.ll
18

"max backedge-taken count" is always a constant. So, -1 is a constant upper bound on %n implied by the nsw.

This revision is now accepted and ready to land.Nov 21 2019, 12:55 AM
This revision was automatically updated to reflect the committed changes.