This is an archive of the discontinued LLVM Phabricator instance.

[SCEV][NFC] Factor out common logic into a separate method
ClosedPublic

Authored by mkazantsev on Feb 16 2018, 1:55 AM.

Details

Summary

SCEV has multiple occurences of code when we need to prove some predicate on
every iteration of a loop and do it with invocations of couple isLoopEntryGuardedByCond,
isLoopBackedgeGuardedByCond. This patch factors out these two calls into a separate
method. It is a preparation step to extend this logic: it is not the only way how we can prove
such conditions.

Diff Detail

Repository
rL LLVM

Event Timeline

mkazantsev created this revision.Feb 16 2018, 1:55 AM
sanjoy accepted this revision.Feb 19 2018, 4:42 PM
sanjoy added inline comments.
include/llvm/Analysis/ScalarEvolution.h
838 ↗(On Diff #134571)

How about calling this isKnownViaInduction?

This revision is now accepted and ready to land.Feb 19 2018, 4:42 PM
mkazantsev added inline comments.Feb 20 2018, 2:29 AM
include/llvm/Analysis/ScalarEvolution.h
838 ↗(On Diff #134571)

You are right, current implementation only proves via induction, but I plan a follow-up change https://reviews.llvm.org/D43375 which proves via monotonicity and not induction. So let's keep it as is.

This revision was automatically updated to reflect the committed changes.