diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-11-27 17:12:30 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-11-27 17:12:30 +0000 |
| commit | 83a4a9868f7b2a086d30807c9d70a411219fe1f4 (patch) | |
| tree | 905e193a2931ab253f52e1c673a8a538d54d0f5d /llvm/lib | |
| parent | ca9e0e83b30ccff770e832e08ba540f1b4735a43 (diff) | |
| download | bcm5719-llvm-83a4a9868f7b2a086d30807c9d70a411219fe1f4.tar.gz bcm5719-llvm-83a4a9868f7b2a086d30807c9d70a411219fe1f4.zip | |
add a deadargelim note.
llvm-svn: 90009
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/README.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index 267f60a2047..4029134f139 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/lib/Target/README.txt @@ -2,6 +2,29 @@ Target Independent Opportunities: //===---------------------------------------------------------------------===// +Dead argument elimination should be enhanced to handle cases when an argument is +dead to an externally visible function. Though the argument can't be removed +from the externally visible function, the caller doesn't need to pass it in. +For example in this testcase: + + void foo(int X) __attribute__((noinline)); + void foo(int X) { sideeffect(); } + void bar(int A) { foo(A+1); } + +We compile bar to: + +define void @bar(i32 %A) nounwind ssp { + %0 = add nsw i32 %A, 1 ; <i32> [#uses=1] + tail call void @foo(i32 %0) nounwind noinline ssp + ret void +} + +The add is dead, we could pass in 'i32 undef' instead. This occurs for C++ +templates etc, which usually have linkonce_odr/weak_odr linkage, not internal +linkage. + +//===---------------------------------------------------------------------===// + With the recent changes to make the implicit def/use set explicit in machineinstrs, we should change the target descriptions for 'call' instructions so that the .td files don't list all the call-clobbered registers as implicit |

