[llvm-commits] CVS: llvm/lib/Target/X86/README.txt

Chris Lattner lattner at cs.uiuc.edu
Thu Jun 15 14:33:43 PDT 2006



Changes in directory llvm/lib/Target/X86:

README.txt updated: 1.116 -> 1.117
---
Log message:

Add a note that Nate noticed.


---
Diffs of the changes:  (+34 -0)

 README.txt |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+)


Index: llvm/lib/Target/X86/README.txt
diff -u llvm/lib/Target/X86/README.txt:1.116 llvm/lib/Target/X86/README.txt:1.117
--- llvm/lib/Target/X86/README.txt:1.116	Sun Jun  4 04:08:00 2006
+++ llvm/lib/Target/X86/README.txt	Thu Jun 15 16:33:31 2006
@@ -668,3 +668,37 @@
 //===---------------------------------------------------------------------===//
 
 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.
+
+//===---------------------------------------------------------------------===//






More information about the llvm-commits mailing list