aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-28 22:30:05 +0000
committerChris Lattner <sabre@nondot.org>2007-12-28 22:30:05 +0000
commita1643ba71a6708cdbd7fd09c067ee5bc0a912ac1 (patch)
tree235ffea7d61debdb86e871aefabe3241cc56ad41
parent9bfcc624bad51270cc033f09a0a23bfc9cabe094 (diff)
downloadexternal_llvm-a1643ba71a6708cdbd7fd09c067ee5bc0a912ac1.zip
external_llvm-a1643ba71a6708cdbd7fd09c067ee5bc0a912ac1.tar.gz
external_llvm-a1643ba71a6708cdbd7fd09c067ee5bc0a912ac1.tar.bz2
add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45388 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/README.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index b94bdea..2ef77cb 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -480,6 +480,38 @@ int i;
}
}
+//===---------------------------------------------------------------------===//
+
+We should investigate an instruction sinking pass. Consider this silly
+example in pic mode:
+
+#include <assert.h>
+void foo(int x) {
+ assert(x);
+ //...
+}
+
+we compile this to:
+_foo:
+ subl $28, %esp
+ call "L1$pb"
+"L1$pb":
+ popl %eax
+ cmpl $0, 32(%esp)
+ je LBB1_2 # cond_true
+LBB1_1: # return
+ # ...
+ addl $28, %esp
+ ret
+LBB1_2: # cond_true
+...
+
+The PIC base computation (call+popl) is only used on one path through the
+code, but is currently always computed in the entry block. It would be
+better to sink the picbase computation down into the block for the
+assertion, as it is the only one that uses it. This happens for a lot of
+code with early outs.
+In this case, whole-function-isel would also handle this.
//===---------------------------------------------------------------------===//