diff options
author | Owen Anderson <resistor@mac.com> | 2007-11-08 01:32:45 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-11-08 01:32:45 +0000 |
commit | bfbc12973d320f9afa5c284e473ea94f277d1c8f (patch) | |
tree | 6db81a9070d73fb9d08f54e02aa8514e6d3c7c36 /llvm/lib/CodeGen/StrongPHIElimination.cpp | |
parent | 4ac4ec215fe6a05552d736fb3dcc247ccb97c8c1 (diff) | |
download | bcm5719-llvm-bfbc12973d320f9afa5c284e473ea94f277d1c8f.tar.gz bcm5719-llvm-bfbc12973d320f9afa5c284e473ea94f277d1c8f.zip |
Take another stab at getting isLiveIn() and isLiveOut() right.
llvm-svn: 43869
Diffstat (limited to 'llvm/lib/CodeGen/StrongPHIElimination.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StrongPHIElimination.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/StrongPHIElimination.cpp b/llvm/lib/CodeGen/StrongPHIElimination.cpp index 200ae8f84e6..5f84b586cb8 100644 --- a/llvm/lib/CodeGen/StrongPHIElimination.cpp +++ b/llvm/lib/CodeGen/StrongPHIElimination.cpp @@ -225,10 +225,9 @@ bool isLiveIn(LiveVariables::VarInfo& V, MachineBasicBlock* MBB) { if (V.AliveBlocks.test(MBB->getNumber())) return true; - for (std::vector<MachineInstr*>::iterator I = V.Kills.begin(), - E = V.Kills.end(); I != E; ++I) - if ((*I)->getParent() == MBB) - return true; + if (V.DefInst->getParent() != MBB && + V.UsedBlocks.test(MBB->getNumber())) + return true; return false; } @@ -236,11 +235,15 @@ bool isLiveIn(LiveVariables::VarInfo& V, MachineBasicBlock* MBB) { /// isLiveOut - help method that determines, from a VarInfo, if a register is /// live out of a block. bool isLiveOut(LiveVariables::VarInfo& V, MachineBasicBlock* MBB) { - if (V.AliveBlocks.test(MBB->getNumber())) - return true; - - if (V.DefInst->getParent() == MBB) + if (MBB == V.DefInst->getParent() || + V.UsedBlocks.test(MBB->getNumber())) { + for (std::vector<MachineInstr*>::iterator I = V.Kills.begin(), + E = V.Kills.end(); I != E; ++I) + if ((*I)->getParent() == MBB) + return false; + return true; + } return false; } |