add a simple optimization
authorChris Lattner <sabre@nondot.org>
Wed, 8 Feb 2006 17:47:22 +0000 (17:47 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 8 Feb 2006 17:47:22 +0000 (17:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26062 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README.txt

index 8481fa6f2cf2f2f54621ad1a4539e0cf6b0be5a3..6ff181771be62fc7ffa995958c34bc07b6d31e19 100644 (file)
@@ -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.
+