diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-28 22:30:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-28 22:30:05 +0000 |
commit | 9d53b611d187b2d6c76dd5fe01015aadbd41b30a (patch) | |
tree | 781288edc864b6a411249e112add7e5f600fb16e /llvm/lib | |
parent | d7980024012a87f7ffbb6eaa734e013a7e4db61a (diff) | |
download | bcm5719-llvm-9d53b611d187b2d6c76dd5fe01015aadbd41b30a.tar.gz bcm5719-llvm-9d53b611d187b2d6c76dd5fe01015aadbd41b30a.zip |
add a note.
llvm-svn: 45388
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/README.txt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index b94bdeac94e..2ef77cb8d30 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/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. //===---------------------------------------------------------------------===// |