aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/README.txt
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-15 21:33:31 +0000
committerChris Lattner <sabre@nondot.org>2006-06-15 21:33:31 +0000
commit8e173de059ab86775d741a53431d8cb746ba7eeb (patch)
tree90610681ad2c868d86021fb207cb95d98f4bf3df /lib/Target/X86/README.txt
parentf8a01a966120a041fe96300271573a8bf5a3e668 (diff)
downloadexternal_llvm-8e173de059ab86775d741a53431d8cb746ba7eeb.zip
external_llvm-8e173de059ab86775d741a53431d8cb746ba7eeb.tar.gz
external_llvm-8e173de059ab86775d741a53431d8cb746ba7eeb.tar.bz2
Add a note that Nate noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/README.txt')
-rw-r--r--lib/Target/X86/README.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt
index 3e40027..b8db3ab 100644
--- a/lib/Target/X86/README.txt
+++ b/lib/Target/X86/README.txt
@@ -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.
+
+//===---------------------------------------------------------------------===//