Commit 0df3a18d authored by Andrew Trick's avatar Andrew Trick
Browse files

Merging 182989: Fix ScalarEvolution::ComputeExitLimitFromCond for 'or' conditions.

    Fixes PR16130 - clang produces incorrect code with loop/expression at -O2.

    This is a 2+ year old bug that's now holding up the release. It's a
    case where we knowingly made aggressive assumptions about undefined
    behavior. These assumptions are wrong when SCEV is computing a
    subexpression that does not directly control the branch. With this
    fix, we avoid making assumptions in those cases but still optimize the
    common case. SCEV's trip count computation for exits controlled by
    'or' expressions is now analagous to the trip count computation for
    loops with multiple exits. I had already fixed the multiple exit case
    to be conservative.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182989 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-svn: 183013
parent 65ac319b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment