[LLVMbugs] [Bug 5256] New: SCEV misses simple finite loop

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Oct 19 16:12:52 PDT 2009


           Summary: SCEV misses simple finite loop
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: gohman at apple.com, llvmbugs at cs.uiuc.edu

Created an attachment (id=3678)
 --> (http://llvm.org/bugs/attachment.cgi?id=3678)

This code sample from bug 2306:

int foo(int left, int right)
        int x=5;
        int *bar = 0;
        while(left<=right) {
                bar = &x;
        if(left<=right) {
                return *bar;
        return 0;

turns into the .ll file attached. The loop isn't eliminated because SCEV can't
seem to figure out the loop evolution in what should be a trivial loop with a
single exit, an indvar incrementing by 1 each time.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list