[LLVMbugs] [Bug 13748] New: r161152 found some limitation on the register allocator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 31 16:00:06 PDT 2012


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

             Bug #: 13748
           Summary: r161152 found some limitation on the register
                    allocator
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9142
  --> http://llvm.org/bugs/attachment.cgi?id=9142
testcase

In the attached testcase r161152 is an improvement all the way to the register
allocator. The only difference is going from

BB#6: derived from LLVM BB %37
    Predecessors according to CFG: BB#5
    %vreg38<def> = MOV32rm <fi#1>, 1, %noreg, 0, %noreg; mem:LD4[%n]
GR32:%vreg38
    %vreg38<def> = ADD32rr %vreg38, %vreg3:sub_32bit<kill>,
%EFLAGS<imp-def,dead>; GR32:%vreg38 GR64_with_sub_8bit:%vreg3
    ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
    %RDI<def> = COPY %vreg2<kill>; GR64:%vreg2
    %ESI<def> = COPY %vreg38<kill>; GR32:%vreg38
    CALL64pcrel32 <ga:@_ZN19nsACString_internal9SetLengthEj>, <regmask>,
%RSP<imp-use>, %RDI<imp-use,kill>, %ESI<imp-use,kill>, %RSP<imp-def>
to

BB#6: derived from LLVM BB %37
    Predecessors according to CFG: BB#5
    %vreg3:sub_32bit<def> = ADD32rm %vreg3:sub_32bit, <fi#1>, 1, %noreg, 0,
%noreg, %EFLAGS<imp-def,dead>; mem:LD4[%n] GR64_with_sub_8bit:%vreg3
    ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
    %RDI<def> = COPY %vreg2<kill>; GR64:%vreg2
    CALL64pcrel32 <ga:@_ZN19nsACString_internal9SetLengthEj>, <regmask>,
%RSP<imp-use>, %RDI<imp-use,kill>, %ESI<imp-use,kill>, %RSP<imp-def>

but while the old code is register allocated to

BB#6: derived from LLVM BB %37
    Live Ins: %R14 %R15 %R12 %R13D %EBP %RCX
    Predecessors according to CFG: BB#5
    %ESI<def> = MOV32rm <fi#1>, 1, %noreg, 0, %noreg; mem:LD4[%n]
    %ESI<def> = ADD32rr %ESI<kill>, %ECX, %EFLAGS<imp-def,dead>,
%RCX<imp-use,kill>
    ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
    %RDI<def> = COPY %R14<kill>
    CALL64pcrel32 <ga:@_ZN19nsACString_internal9SetLengthEj>, <regmask>,
%RSP<imp-use>, %RDI<imp-use,kill>, %ESI<imp-use,kill>, %RSP<imp-def>

The new one goes to

BB#6: derived from LLVM BB %37
    Live Ins: %R15 %R14 %RBP %R12 %R13D
    Predecessors according to CFG: BB#5
    %R14D<def> = ADD32rm %R14D, <fi#1>, 1, %noreg, 0, %noreg,
%EFLAGS<imp-def,dead>, %R14<imp-use,kill>, %R14<imp-def>; mem:LD4[%n]
    ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
    %RDI<def> = COPY %R15<kill>
    %ESI<def> = COPY %R14D, %R14<imp-use,kill>
    CALL64pcrel32 <ga:@_ZN19nsACString_internal9SetLengthEj>, <regmask>,
%RSP<imp-use>, %RDI<imp-use,kill>, %ESI<imp-use,kill>, %RSP<imp-def>

and ends up needing an extra stack slot for spilling.

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