Add a note that Nate noticed.
authorChris Lattner <sabre@nondot.org>
Thu, 15 Jun 2006 21:33:31 +0000 (21:33 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 15 Jun 2006 21:33:31 +0000 (21:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28808 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README.txt

index 3e40027e9b6e2c9f72849ad836dc00abba647996..b8db3ab94e1f22d7bf467f4d415bf50131d1fbbe 100644 (file)
@@ -668,3 +668,37 @@ do not make use of.
 //===---------------------------------------------------------------------===//
 
 We should handle __attribute__ ((__visibility__ ("hidden"))).
+
+//===---------------------------------------------------------------------===//
+
+Consider:
+int foo(int *a, int t) {
+int x;
+for (x=0; x<40; ++x)
+   t = t + a[x] + x;
+return t;
+}
+
+We generate:
+LBB1_1: #cond_true
+        movl %ecx, %esi
+        movl (%edx,%eax,4), %edi
+        movl %esi, %ecx
+        addl %edi, %ecx
+        addl %eax, %ecx
+        incl %eax
+        cmpl $40, %eax
+        jne LBB1_1      #cond_true
+
+GCC generates:
+
+L2:
+        addl    (%ecx,%edx,4), %eax
+        addl    %edx, %eax
+        addl    $1, %edx
+        cmpl    $40, %edx
+        jne     L2
+
+Smells like a register coallescing/reassociation issue.
+
+//===---------------------------------------------------------------------===//