[ScalarEvolution] Handling for ICmp occuring in the evolution chain.
authorJatin Bhateja <jatin.bhateja@gmail.com>
Wed, 18 Oct 2017 01:36:16 +0000 (01:36 +0000)
committerJatin Bhateja <jatin.bhateja@gmail.com>
Wed, 18 Oct 2017 01:36:16 +0000 (01:36 +0000)
commit1fc49627e498eeaedcc79ae301df1adf47592583
treed30f400700370123be7caec68e639640df9e41df
parent9e148e95905a78de95eaa8220c49988d44756fc2
[ScalarEvolution] Handling for ICmp occuring in the evolution chain.

Summary:
 If a compare instruction is same or inverse of the compare in the
 branch of the loop latch, then return a constant evolution node.
 Currently scope of evaluation is limited to SCEV computation for
 PHI nodes.

 This shall facilitate computations of loop exit counts in cases
 where compare appears in the evolution chain of induction variables.

 Will fix PR 34538
Reviewers: sanjoy, hfinkel, junryoungju

Reviewed By: junryoungju

Subscribers: javed.absar, llvm-commits

Differential Revision: https://reviews.llvm.org/D38494

llvm-svn: 316054
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/test/Analysis/ScalarEvolution/pr34538.ll [new file with mode: 0644]