[LLVMbugs] [Bug 4544] New: regalloc problem with insert_subreg

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jul 12 13:18:58 PDT 2009


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

           Summary: regalloc problem with insert_subreg
           Product: libraries
           Version: 1.0
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu


It looks like regalloc is incorrectly updating machine instrs after coalescing.
 With the attached patch on the attached .bc file, I get:

$ llc bugpoint-reduced-simplified.bc -o - -print-machineinstrs
...
        %reg1039<def> = MOV32r0 %EFLAGS<imp-def>
        %reg1040<def> = IMPLICIT_DEF
        %reg1037<def> = INSERT_SUBREG %reg1040, %reg1039, 4
..
        %RSI<def> = MOV64rr %reg1037
        %RDX<def> = MOV64rr %reg1037
        %RCX<def> = MOV64rr %reg1037

The after regalloc:

        %ESI<def> = MOV32r0 %EFLAGS<imp-def,dead>
        %RDX<def> = MOV32ri 0
        %RCX<def> = MOV32ri 0
        %R8<def> = MOV64rr %RAX<kill>

The set of ESI seems fine.  The set of RDX/RCX are wrong (they should be
EDX/ECX).

This smells like a simple remat problem, or an "is cheap as a move" problem of
some sort.  It would also be nice to use MOV32ri0 for EDX/ECX instead of
MOV32ri, but that's a micro optimization possible because the flags are dead.


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