aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-03-09 09:48:56 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-03-09 09:48:56 +0000
commite2ee99620fa6e428292737349d8e28bbcdcdaa0b (patch)
treeeb702a73a6712af38ef5019d3c715cfceb9bbd5b
parent219705131d5f6911d4b40fcfdcc614a7f3a5e035 (diff)
If a virtual register is already marked alive in this block, that means it is
alive in one of the successor block. Do not add it to the kill list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35041 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/LiveVariables.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp
index aec62dfcdf..539799ec58 100644
--- a/lib/CodeGen/LiveVariables.cpp
+++ b/lib/CodeGen/LiveVariables.cpp
@@ -152,7 +152,12 @@ void LiveVariables::HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB,
"Should have kill for defblock!");
// Add a new kill entry for this basic block.
- VRInfo.Kills.push_back(MI);
+ unsigned BBNum = MBB->getNumber();
+ // If this virtual register is already marked as alive in this basic block,
+ // that means it is alive in at least one of the successor block, it's not
+ // a kill.
+ if (VRInfo.AliveBlocks.size() <= BBNum || !VRInfo.AliveBlocks[BBNum])
+ VRInfo.Kills.push_back(MI);
// Update all dominating blocks to mark them known live.
for (MachineBasicBlock::const_pred_iterator PI = MBB->pred_begin(),