[llvm-bugs] [Bug 47776] New: Assertio n `isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 9 01:29:11 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47776

            Bug ID: 47776
           Summary: Assertio n `isLoopInvariant(Operands[i], L) &&
                    "SCEVAddRecExpr operand is not loop-invariant!"'
                    failed.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: max.kazantsev at azul.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24038
  --> https://bugs.llvm.org/attachment.cgi?id=24038&action=edit
test.ll

Download test.ll, run `opt -loop-reduce -S`. SCEV fails an sssertio
n `isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not
loop-invariant!"' failed.

This happens inside applyLoopGuards function.

The guilty change is:

commit d4ddf63fc40cfbbc348adcc45cdc6f6d78268c5c
Author: Florian Hahn <flo at fhahn.com>
Date:   Thu Sep 24 11:06:55 2020 +0100

    [SCEV] Use loop guard info when computing the max BE taken count in
howFarToZero.

    For some expressions, we can use information from loop guards when
    we are looking for a maximum. This patch applies information from
    loop guards to the expression used to compute the maximum backedge
    taken count in howFarToZero. It currently replaces an unknown
    expression X with UMin(X, Y), if the loop is guarded by
    X ult Y.

    This patch is minimal in what conditions it applies, and there
    are a few TODOs to generalize.

    This partly addresses PR40961. We will also need an update to
    LV to address it completely.

    Reviewed By: reames

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201009/3e9f5d40/attachment.html>


More information about the llvm-bugs mailing list