[LLVMbugs] [Bug 368] NEW: [sparcv9] null often spilled to constant pool

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jun 10 15:50:36 PDT 2004


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=368

           Summary: [sparcv9] null often spilled to constant pool
           Product: libraries
           Version: trunk
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SPARC Backend
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: gaeke+bugs at uiuc.edu


I have noticed that the 64-bit constant pointer null is often spilled to the
constant pool in the sparcv9 backend, requiring a 7-instruction sequence to
load it out of the constant pool. This is a pretty serious pessimization. For
an example of this behavior, try running llc -print-machineinstrs on the
following code:

implementation

void %foobar (sbyte* %arg) {
  ret void
}

void %caller () {
  call void %foobar (sbyte* null)
  ret void
}

For %caller, SunPRO cc with -O on the C-backend code produces the following
(ignoring prolog/epilog instrs):

/* 0x0004        */     or  %g0,0,%o0
/* 0x0008        */     call    foobar  ! params =  %o0 ! Result =  ! (tail call)

llc produces the following:

    sethi   %hh(.CPI_caller_0), %o1
    sethi   %lm(.CPI_caller_0), %o0
    or  %o1, %hm(.CPI_caller_0), %o1
    sllx    %o1, 32, %o1
    or  %o0, %o1, %o0
    or  %o0, %lo(.CPI_caller_0), %o0
    ldx [%o0+0], %o0
    call    foobar

.CPI_caller_0:
    .xword  0



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list