This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Introduce SCEVPostIncRewriter
ClosedPublic

Authored by skatkov on Feb 19 2018, 10:36 PM.

Details

Summary

The patch introduces the SCEVPostIncRewriter rewriter which
is similar to SCEVInitRewriter but rewrites AddRec with post increment
value of this AddRec.

This is a preparation for re-writing isKnownPredicate utility as
described in https://reviews.llvm.org/D42417.

Diff Detail

Repository
rL LLVM

Event Timeline

skatkov created this revision.Feb 19 2018, 10:36 PM
This revision now requires changes to proceed.Feb 19 2018, 10:55 PM
skatkov updated this revision to Diff 135013.Feb 19 2018, 11:43 PM

Please take a look.

sanjoy accepted this revision.Feb 25 2018, 1:09 PM

lgtm with minor fixes

lib/Analysis/ScalarEvolution.cpp
4142 ↗(On Diff #135013)

We don't need IgnoreOtherLoops right? If so, let's remove it for now.

4166 ↗(On Diff #135013)

This should be called something more descriptive -- perhaps SawLoopVariantSCEVUnknown or something like that.

Also applies to D43498

4168 ↗(On Diff #135013)

s/isSeenOtherLoops/hasSeenOtherLoops/

Also applies to D43498

This revision is now accepted and ready to land.Feb 25 2018, 1:09 PM
skatkov added inline comments.Feb 25 2018, 9:17 PM
lib/Analysis/ScalarEvolution.cpp
4142 ↗(On Diff #135013)

If I understood it correctly the idea is just to remove it for now to make patch mostly NFC (related to D43498) and add it when we need it in "IsKnownPredicated Fix" patch. Ok, I'll do that.

sanjoy added inline comments.Feb 25 2018, 9:33 PM
lib/Analysis/ScalarEvolution.cpp
4142 ↗(On Diff #135013)

No, I meant always have the behavior be to ignore other loops (so you don't have to change anything in D43498).

You might also want to change SCEVInitRewriter default IgnoreOtherLoops to true for consistency.

This revision was automatically updated to reflect the committed changes.