[LLVMbugs] [Bug 1877] New: Backedge copy not coalesced in Freebench/neural

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Dec 23 01:04:08 PST 2007


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

           Summary: Backedge copy not coalesced in Freebench/neural
           Product: libraries
           Version: 1.0
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: code-quality
          Severity: minor
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org
                CC: evan.cheng at apple.com, llvmbugs at cs.uiuc.edu


The significant (negative) performance delta on Freebench/neural on x86 is due
to a backedge copy not getting coalesced.  The backedge critical edge is then
split to hold the copy, and the critical edge block is put into a very bad
place.  This makes the code run significantly slower than the GCC code, whcih
doesn't make this mistake.  Here's a reduced testcase:

unsigned NNTOT;
float **Tmatrix;
volatile float G;
int runcont (signed int source[], signed int dest[]) {
  int row = 0, neuron;
   // for(row=0; row<NNTOT; row++) {
      float thesum=0.0;
      for(neuron=0; neuron<NNTOT; neuron++) 
        thesum+=Tmatrix[row][neuron]*source[neuron];
      G=thesum;   
    //}
}

If you enable the two commented out lines, you'll get the following really bad
code:

LBB1_4: # bb1
        cvtsi2ss        (%ecx,%edi,4), %xmm0
        mulss   (%esi,%edi,4), %xmm0
        incl    %edi
        cmpl    %eax, %edi
        addss   %xmm1, %xmm0
        jb      LBB1_8  # bb1.bb1_crit_edge
LBB1_5: # bb23
...

LBB1_8: # bb1.bb1_crit_edge
        movaps  %xmm0, %xmm1
        jmp     LBB1_4  # bb1

If the lines are commented out, you get the same bad code, but the edge happens
to be put into a better place by luck.

-Chris


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