aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-06-05 00:30:45 +0000
committerDale Johannesen <dalej@apple.com>2010-06-05 00:30:45 +0000
commitdf1a7f83bf1322a7dba1e393d316420665a6a651 (patch)
tree967dff35ad36f757d6da88c69af13f85a21824e9 /llvm/lib/CodeGen/LiveVariables.cpp
parentd7910a805da7ef20cf65b944b0102466ecbb4016 (diff)
downloadllvm-df1a7f83bf1322a7dba1e393d316420665a6a651.zip
llvm-df1a7f83bf1322a7dba1e393d316420665a6a651.tar.gz
llvm-df1a7f83bf1322a7dba1e393d316420665a6a651.tar.bz2
Fix some liveout handling related to tail calls, see comments.
I don't think this ever resulted in problems on x86, but it would on ARM. llvm-svn: 105509
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 079684ee..fe6b290 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -609,7 +609,12 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
// Finally, if the last instruction in the block is a return, make sure to
// mark it as using all of the live-out values in the function.
- if (!MBB->empty() && MBB->back().getDesc().isReturn()) {
+ // Things marked both call and return are tail calls; do not do this for
+ // them. The tail callee need not take the same registers as input
+ // that it produces as output, and there are dependencies for its input
+ // registers elsewhere.
+ if (!MBB->empty() && MBB->back().getDesc().isReturn()
+ && !MBB->back().getDesc().isCall()) {
MachineInstr *Ret = &MBB->back();
for (MachineRegisterInfo::liveout_iterator