[llvm-commits] CVS: llvm/lib/CodeGen/LiveVariables.cpp

Evan Cheng evan.cheng at apple.com
Fri Mar 9 01:49:13 PST 2007



Changes in directory llvm/lib/CodeGen:

LiveVariables.cpp updated: 1.69 -> 1.70
---
Log message:

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.

---
Diffs of the changes:  (+6 -1)

 LiveVariables.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.69 llvm/lib/CodeGen/LiveVariables.cpp:1.70
--- llvm/lib/CodeGen/LiveVariables.cpp:1.69	Fri Mar  9 00:02:17 2007
+++ llvm/lib/CodeGen/LiveVariables.cpp	Fri Mar  9 03:48:56 2007
@@ -152,7 +152,12 @@
          "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(),






More information about the llvm-commits mailing list