aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-08 17:47:22 +0000
committerChris Lattner <sabre@nondot.org>2006-02-08 17:47:22 +0000
commitdba382b16ae43bf0bfac3e67cf6ffe2f20520ca5 (patch)
treedc18b0c3045f77b7fa387b2ee93e5ed8c6aa6453 /lib
parent7e8443fd5afca34d637cf0f77a67c91c1b41da4d (diff)
add a simple optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26062 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/README.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt
index 8481fa6f2c..6ff181771b 100644
--- a/lib/Target/X86/README.txt
+++ b/lib/Target/X86/README.txt
@@ -411,3 +411,19 @@ void clearbit(int *target, int bit) {
*target &= ~(1 << bit);
}
+//===---------------------------------------------------------------------===//
+
+Easy: Global addresses are not always allowed as immediates. For this:
+
+int dst = 0; int *ptr = 0;
+void foo() { ptr = &dst; }
+
+we get this:
+
+_foo:
+ movl $_dst, %eax
+ movl %eax, _ptr
+ ret
+
+When: "movl $_dst, _ptr" is sufficient.
+