[SCEV] Fix incorrect loop exit count analysis.
authorMindong Chen <chenmindong1@huawei.com>
Tue, 26 Jan 2021 16:10:37 +0000 (00:10 +0800)
committerMindong Chen <chenmindong1@huawei.com>
Wed, 27 Jan 2021 11:36:05 +0000 (19:36 +0800)
commit00fcc036873164029d30819354fa923b7254cd81
tree9b94e898a91c3d3ec7bff36470db10098280f4c0
parent30d9ca1bd9de8286539577d0abfc812ad122861c
[SCEV] Fix incorrect loop exit count analysis.

In computeLoadConstantCompareExitLimit, the addrec used to compute the
exit count should be from the loop which the exiting block belongs to.

Reviewed by: mkazantsev

Differential Revision: https://reviews.llvm.org/D92367
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/incorrect-exit-count.ll