[LLVMbugs] [Bug 1143] NEW: Missed LICM load/store hoisting opportunities

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Jan 29 10:12:31 PST 2007


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

           Summary: Missed LICM load/store hoisting opportunities
           Product: libraries
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Global Analyses
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


Consider:

 struct a  {
   int X, Y;
 };
 struct a arr[100];
 
 void foo (unsigned b) {
   unsigned i;
   for (i = 0; i < 100; i++) {
     arr[b+8].X += i;
     arr[b+9].X += i;
   }
 }

 void foo2(struct a *A, unsigned b) {
   unsigned i;
 
   for (i = 0; i < 100; i++) {
     A[b].X += i;
     A[b+1].Y += i;
   }
 }

When I run:
$ llvm-gcc t.c -S -emit-llvm -O3 -o -

I see that the load/store accesses in the first loop are not hoisted.  This is due to BasicAA not 
determining that the pointer can't alias.

In the second loop, some sort of phase ordering issue prevents one of the accesses from being hoisted.  
If I run -licm again on the output, both are hoisted.

-Chris



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