diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-11-11 17:51:27 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-11-11 17:51:27 +0000 |
| commit | 539bdf0487aeb615d3672aedd2f45e73751d8eba (patch) | |
| tree | a0fa92efb16e5ac1507a25aa438ef33ab593abb8 /llvm/lib | |
| parent | 7eb84155a5a79d5ff7c207542a6b6099e67e1c12 (diff) | |
| download | bcm5719-llvm-539bdf0487aeb615d3672aedd2f45e73751d8eba.tar.gz bcm5719-llvm-539bdf0487aeb615d3672aedd2f45e73751d8eba.zip | |
add a note
llvm-svn: 86847
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/README.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index ac2ea6d6c58..d999f4c3f35 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/lib/Target/README.txt @@ -1682,3 +1682,31 @@ entry: } //===---------------------------------------------------------------------===// + +IPSCCP does not currently propagate argument dependent constants through +functions where it does not not all of the callers. This includes functions +with normal external linkage as well as templates, C99 inline functions etc. +Specifically, it does nothing to: + +define i32 @test(i32 %x, i32 %y, i32 %z) nounwind { +entry: + %0 = add nsw i32 %y, %z + %1 = mul i32 %0, %x + %2 = mul i32 %y, %z + %3 = add nsw i32 %1, %2 + ret i32 %3 +} + +define i32 @test2() nounwind { +entry: + %0 = call i32 @test(i32 1, i32 2, i32 4) nounwind + ret i32 %0 +} + +It would be interesting extend IPSCCP to be able to handle simple cases like +this, where all of the arguments to a call are constant. Because IPSCCP runs +before inlining, trivial templates and inline functions are not yet inlined. +The results for a function + set of constant arguments should be memoized in a +map. + +//===---------------------------------------------------------------------===// |

