[LLVMbugs] [Bug 943] NEW: Too much spill code generated after loop unrolling

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Oct 11 16:48:44 PDT 2006


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

           Summary: Too much spill code generated after loop unrolling
           Product: libraries
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: isanbard at gmail.com


This code:

int value(uint64 b1, uint64 b2)                                                                                   
{                                                                                                                 
  int i, j, k;                                                                                                    
  int value = 0;                                                                                                  
                                                                                                                  
  for (k = 0; k < 2; k++)                                                                                         
    for (i = 0; i < 6; i++)                                                                                       
      for (j = 0; j < 2; j++)                                                                                     
        if ((b2 & 0xf << (j + i * 6)) == 0xf << (j + i * 6))                                                      
          value += 1000;                                                                                          
                                                                                                                  
  return value;                                                                                                   
}                                                                                                                 

generates too many unnecessary spills/reloads when rerun through the optimizer (at -O2). See "***" 
below:

LBB1_1: #bb17.preheader                                                                                           
        movl $15, %eax                                                                                            
***     movb 39(%esp), %cl                                                                                        
        movl %eax, %edx                                                                                           
        shll %cl, %edx                                                                                            
***     movb 39(%esp), %cl                                                                                        
        incb %cl                                                                                                  
        shll %cl, %eax                                                                                            
        movl %edx, %ecx                                                                                           

The result is that the loop will run slower than if optimizations were turned on only once.



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