From ebcba612b537f45a033ccd9a60bee0c45e2e2ded Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 23 Jun 2008 23:41:14 +0000 Subject: This situation can occur: ,------. | | | v | t2 = phi ... t1 ... | | | v | t1 = ... | ... = ... t1 ... | | `------' where there is a use in a PHI node that's a predecessor to the defining block. We don't want to mark all predecessors as having the value "alive" in this case. Also, the assert was too restrictive and didn't handle this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52655 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveVariables.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/LiveVariables.cpp') diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index 4a4ef37b00..bc73b6841c 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -139,8 +139,23 @@ void LiveVariables::HandleVirtRegUse(unsigned reg, MachineBasicBlock *MBB, assert(VRInfo.Kills[i]->getParent() != MBB && "entry should be at end!"); #endif - assert(MBB != MRI->getVRegDef(reg)->getParent() && - "Should have kill for defblock!"); + // This situation can occur: + // + // ,------. + // | | + // | v + // | t2 = phi ... t1 ... + // | | + // | v + // | t1 = ... + // | ... = ... t1 ... + // | | + // `------' + // + // where there is a use in a PHI node that's a predecessor to the defining + // block. We don't want to mark all predecessors as having the value "alive" + // in this case. + if (MBB == MRI->getVRegDef(reg)->getParent()) return; // Add a new kill entry for this basic block. If this virtual register is // already marked as alive in this basic block, that means it is alive in at -- cgit v1.2.3-18-g5258