This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Extends the SCEVInitRewriter
ClosedPublic

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

Details

Summary

The patch introduces an additional parameter IgnoreOtherLoops to SCEVInitRewriter.
if it is equal to true then rewriter will not invalidate result in case
SCEV depends on other loops then specified during creation.

The patch does not change the default behavior.
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:21 PM
sanjoy requested changes to this revision.Feb 19 2018, 10:54 PM
sanjoy added inline comments.
lib/Analysis/ScalarEvolution.cpp
4097 ↗(On Diff #135007)

I would factor this a bit differently --

  • Don't pipe in IgnoreOtherLoops into the SCEVInitRewriter object. Instead rename Valid to SeenOtherLoops.
  • Handle the IgnoreOtherLoops logic in SCEVInitRewriter:: rewrite itself as: return Rewriter.seenOtherLoops() && !IgnoreOtherLoops ? SE.getCouldNotCompute() : Result;.
This revision now requires changes to proceed.Feb 19 2018, 10:54 PM
skatkov updated this revision to Diff 135011.Feb 19 2018, 11:19 PM

please take a look.

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

lgtm with the two other issues mentioned in D43499 addressed.

This revision is now accepted and ready to land.Feb 25 2018, 1:10 PM
This revision was automatically updated to reflect the committed changes.