Page MenuHomePhabricator

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

Authored by reames on Tue, Nov 19, 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.Tue, Nov 19, 1:09 PM
fhahn added a subscriber: fhahn.Tue, Nov 19, 2:45 PM
ebrevnov added inline comments.Tue, Nov 19, 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.Wed, Nov 20, 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.Thu, Nov 21, 12:55 AM
This revision was automatically updated to reflect the committed changes.