OSDN Git Service

[SCEV] Handle case where MaxBECount is less precise than ExactBECount for OR.
authorFlorian Hahn <flo@fhahn.com>
Sat, 2 Mar 2019 02:31:44 +0000 (02:31 +0000)
committerFlorian Hahn <flo@fhahn.com>
Sat, 2 Mar 2019 02:31:44 +0000 (02:31 +0000)
commitf370f2847c4f93e9140b21e37267600e926f96aa
treedad31a9de0617bc3a60eea9ff5bfa21126d51f69
parent76b7cba4c016223970af88c70cd27cf3ab29db9f
[SCEV] Handle case where MaxBECount is less precise than ExactBECount for OR.

In some cases, MaxBECount can be less precise than ExactBECount for AND
and OR (the AND case was PR26207). In the OR test case, both ExactBECounts are
undef, but MaxBECount are different, so we hit the assertion below. This
patch uses the same solution the AND case already uses.

Assertion failed:
   ((isa<SCEVCouldNotCompute>(ExactNotTaken) || !isa<SCEVCouldNotCompute>(MaxNotTaken))
     && "Exact is not allowed to be less precise than Max"), function ExitLimit

This patch also consolidates test cases for both AND and OR in a single
test case.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13245

Reviewers: sanjoy, efriedma, mkazantsev

Reviewed By: sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355259 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/exact-exit-count-more-precise.ll [new file with mode: 0644]
test/Transforms/IndVarSimplify/pr26207.ll [deleted file]