HomePhabricator

[SCEV] Handle case where MaxBECount is less precise than ExactBECount for OR.

Description

[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

Details

Committed
fhahnMar 1 2019, 6:31 PM
Reviewer
sanjoy
Differential Revision
D58853: [SCEV] Handle case where MaxBECount is less precise than ExactBECount for OR.
Parents
rL355258: Add test case for truncate funnel shifts. NFC
Branches
Unknown
Tags
Unknown