[llvm-bugs] [Bug 28830] New: SCEV hangs when creating SCEVs for a long chain of add/mul instructions

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 3 10:49:51 PDT 2016


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

            Bug ID: 28830
           Summary: SCEV hangs when creating SCEVs for a long chain of
                    add/mul instructions
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: li1.huang at intel.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following code causes SCEV to hang due to endless multiplication expanding
in getMulExpr (ScalarEvolution.cpp), when compiled with clang –S –O2. 

int get(unsigned n)
{
    unsigned i, j, mult = 1;
    for (i = 0; i < 1; i++) {
        for (j = 0; j < 30; j++) {
            mult *= n++;
        }
    }
    return mult;
}

At some point the inner loop is completed unrolled (by 30) to a long chain of
“add” and “mult” instructions, then indvars follows loop-unroll and triggers
SCEV creations for this long instruction chain. If I change the trip count of
inner loop to 15, then it could finish the work after a short delay, but the
time it spends on creating SCEV seems to grow exponentially.

-- 
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/20160803/5287d25a/attachment.html>


More information about the llvm-bugs mailing list