[LLVMbugs] [Bug 9757] Suboptimal register allocation/scheduling on simple function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 21 03:10:53 PDT 2011


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

Sylvère Teissier <quickslyver at free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |LATER

--- Comment #2 from Sylvère Teissier <quickslyver at free.fr> 2011-04-21 05:10:52 CDT ---
It seems that the problem is a selection and sheduling problem, not a register
allocation problem.

after scheduling we have something like this: (simplified)

 str    lr, [sp, #-4]!
    sub    sp, #4
    copy    vreg0 <- R0
    copy    vreg1 <- R1
    str     vreg1 -> sp
    copy    R0 <- sp
    copy    R2 <- #4
    copy    R1 <- vreg0 
    bl    bar
    add    sp, #4
    ldr    lr, [sp], #4
    bx    lr

register allocator can't reschedule

"copy    vreg1 <- R1 " after "str     vreg1 -> sp"

because it's not its job.

The only solution to solve this problem would be a post-processing pass after
register allocation to try to merge copies like this

But does it really worth it ?

-- 
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