http://llvm.org/bugs/show_bug.cgi?id=11175

           Summary: LoopRotation pass too restrictive
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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

Attached is a test case that illustrates how GCC generates dramatically
superior code for a loop for ARM. LLVM could do something comparable if the
LoopRotation pass would not reject loops that have more than one exit. If
LoopRotation would properly handle such loops, then induction-variable analysis
and LICM would have more opportunities to clean things up (as is apparently
done in GCC).

Compiled with -O3, the LLVM generates the following loop code of 10
instructions:

.LBB0_1:                                @ %while.cond.i
                                        @ =>This Inner Loop Header: Depth=1
        add     r1, r0, #5
        cmp     r1, #1
        mov     r1, #0
        blt     .LBB0_3
        ldr     r2, [r4, -r0, lsl #2]
        ldr     r3, [r5, -r0, lsl #2]
        sub     r0, r0, #1
        mov     r1, #1
        tst     r3, r2
        beq     .LBB0_1


By contrast GCC generates the following 6-instruction loop:


.L3:
        ldr     r0, [r3], #4
        ldr     r1, [r2, #4]!
        tst     r0, r1
        bne     .L4
        cmp     r3, ip
        bne     .L3

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to