From fbbdb92c9d58a3eefd49c0202cb1ca2d8c1b5d5c Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 18 Apr 2007 05:04:38 +0000 Subject: [PATCH] VarInfo::UsedBlocks is no longer used. Remove. llvm-svn: 36250 --- include/llvm/CodeGen/LiveVariables.h | 4 ---- lib/CodeGen/LiveIntervalAnalysis.cpp | 3 +-- lib/CodeGen/LiveVariables.cpp | 9 +-------- lib/CodeGen/PHIElimination.cpp | 3 --- lib/CodeGen/TwoAddressInstructionPass.cpp | 4 ---- 5 files changed, 2 insertions(+), 21 deletions(-) diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 6c58815e273..d87d64bb824 100644 --- a/include/llvm/CodeGen/LiveVariables.h +++ b/include/llvm/CodeGen/LiveVariables.h @@ -79,10 +79,6 @@ public: /// BitVector AliveBlocks; - /// UsedBlocks - Set of blocks of which this value is actually used. This - /// is a bit set which uses the basic block number as an index. - BitVector UsedBlocks; - /// NumUses - Number of uses of this register across the entire function. /// unsigned NumUses; diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 8b181150f64..6521d97805a 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1058,10 +1058,9 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI, for (const unsigned *AS = mri_->getAliasSet(repDstReg); *AS; ++AS) getInterval(*AS).MergeInClobberRanges(SrcInt); } else { - // Merge UsedBlocks info if the destination is a virtual register. + // Merge use info if the destination is a virtual register. LiveVariables::VarInfo& dVI = lv_->getVarInfo(repDstReg); LiveVariables::VarInfo& sVI = lv_->getVarInfo(repSrcReg); - dVI.UsedBlocks |= sVI.UsedBlocks; dVI.NumUses += sVI.NumUses; } diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index 8a8185c55f8..0e0fecedf56 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -48,9 +48,6 @@ void LiveVariables::VarInfo::dump() const { cerr << " Alive in blocks: "; for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) if (AliveBlocks[i]) cerr << i << ", "; - cerr << " Used in blocks: "; - for (unsigned i = 0, e = UsedBlocks.size(); i != e; ++i) - if (UsedBlocks[i]) cerr << i << ", "; cerr << "\n Killed by:"; if (Kills.empty()) cerr << " No instructions.\n"; @@ -73,7 +70,6 @@ LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) { } VarInfo &VI = VirtRegInfo[RegIdx]; VI.AliveBlocks.resize(MF->getNumBlockIDs()); - VI.UsedBlocks.resize(MF->getNumBlockIDs()); return VI; } @@ -138,9 +134,6 @@ void LiveVariables::HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB, MachineInstr *MI) { assert(VRInfo.DefInst && "Register use before def!"); - unsigned BBNum = MBB->getNumber(); - - VRInfo.UsedBlocks[BBNum] = true; VRInfo.NumUses++; // Check to see if this basic block is already a kill block... @@ -163,7 +156,7 @@ void LiveVariables::HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB, // 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[BBNum]) + if (!VRInfo.AliveBlocks[MBB->getNumber()]) VRInfo.Kills.push_back(MI); // Update all dominating blocks to mark them known live. diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index 513bfdeb256..0b77fe26696 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -163,8 +163,6 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB, // Realize that the destination register is defined by the PHI copy now, not // the PHI itself. LV->getVarInfo(DestReg).DefInst = PHICopy; - - LV->getVarInfo(IncomingReg).UsedBlocks[MBB.getNumber()] = true; } // Adjust the VRegPHIUseCount map to account for the removal of this PHI @@ -215,7 +213,6 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB, // instruction kills the incoming value. // LiveVariables::VarInfo &InRegVI = LV->getVarInfo(SrcReg); - InRegVI.UsedBlocks[opBlock.getNumber()] = true; // Loop over all of the successors of the basic block, checking to see // if the value is either live in the block, or if it is killed in the diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 9209420e3e1..b14a95e406c 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -197,10 +197,6 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { LiveVariables::VarInfo& varInfo = LV.getVarInfo(regA); varInfo.DefInst = prevMi; - // update live variables for regB - LiveVariables::VarInfo& varInfoB = LV.getVarInfo(regB); - // regB is used in this BB. - varInfoB.UsedBlocks[mbbi->getNumber()] = true; if (LV.removeVirtualRegisterKilled(regB, mbbi, mi)) LV.addVirtualRegisterKilled(regB, prevMi);