Add another important case we miss
authorChris Lattner <sabre@nondot.org>
Thu, 8 Dec 2005 07:13:28 +0000 (07:13 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 8 Dec 2005 07:13:28 +0000 (07:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24639 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/README.txt

index 580affb688ddbda24d97f8ff30b9c100ad12ae1c..2897655d2d09a70e7a6551dfc1db904f08facabb 100644 (file)
@@ -222,3 +222,22 @@ The two-addr pass or RA needs to learn when it is profitable to commute an
 instruction to avoid a copy AFTER the 2-addr instruction.  The 2-addr pass
 currently only commutes to avoid inserting a copy BEFORE the two addr instr.
 
+===-------------------------------------------------------------------------===
+
+Compile offsets from allocas:
+
+int *%test() {
+        %X = alloca { int, int }
+        %Y = getelementptr {int,int}* %X, int 0, uint 1
+        ret int* %Y
+}
+
+into a single add, not two:
+
+_test:
+        addi r2, r1, -8
+        addi r3, r2, 4
+        blr
+
+--> important for C++.
+