VarInfo::UsedBlocks is no longer used. Remove.

llvm-svn: 36250
This commit is contained in:
Evan Cheng 2007-04-18 05:04:38 +00:00
parent c07f29d206
commit fbbdb92c9d
5 changed files with 2 additions and 21 deletions

View File

@ -79,10 +79,6 @@ public:
/// ///
BitVector AliveBlocks; 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. /// NumUses - Number of uses of this register across the entire function.
/// ///
unsigned NumUses; unsigned NumUses;

View File

@ -1058,10 +1058,9 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
for (const unsigned *AS = mri_->getAliasSet(repDstReg); *AS; ++AS) for (const unsigned *AS = mri_->getAliasSet(repDstReg); *AS; ++AS)
getInterval(*AS).MergeInClobberRanges(SrcInt); getInterval(*AS).MergeInClobberRanges(SrcInt);
} else { } 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& dVI = lv_->getVarInfo(repDstReg);
LiveVariables::VarInfo& sVI = lv_->getVarInfo(repSrcReg); LiveVariables::VarInfo& sVI = lv_->getVarInfo(repSrcReg);
dVI.UsedBlocks |= sVI.UsedBlocks;
dVI.NumUses += sVI.NumUses; dVI.NumUses += sVI.NumUses;
} }

View File

@ -48,9 +48,6 @@ void LiveVariables::VarInfo::dump() const {
cerr << " Alive in blocks: "; cerr << " Alive in blocks: ";
for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i)
if (AliveBlocks[i]) cerr << 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:"; cerr << "\n Killed by:";
if (Kills.empty()) if (Kills.empty())
cerr << " No instructions.\n"; cerr << " No instructions.\n";
@ -73,7 +70,6 @@ LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) {
} }
VarInfo &VI = VirtRegInfo[RegIdx]; VarInfo &VI = VirtRegInfo[RegIdx];
VI.AliveBlocks.resize(MF->getNumBlockIDs()); VI.AliveBlocks.resize(MF->getNumBlockIDs());
VI.UsedBlocks.resize(MF->getNumBlockIDs());
return VI; return VI;
} }
@ -138,9 +134,6 @@ void LiveVariables::HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB,
MachineInstr *MI) { MachineInstr *MI) {
assert(VRInfo.DefInst && "Register use before def!"); assert(VRInfo.DefInst && "Register use before def!");
unsigned BBNum = MBB->getNumber();
VRInfo.UsedBlocks[BBNum] = true;
VRInfo.NumUses++; VRInfo.NumUses++;
// Check to see if this basic block is already a kill block... // 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, // 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 // that means it is alive in at least one of the successor block, it's not
// a kill. // a kill.
if (!VRInfo.AliveBlocks[BBNum]) if (!VRInfo.AliveBlocks[MBB->getNumber()])
VRInfo.Kills.push_back(MI); VRInfo.Kills.push_back(MI);
// Update all dominating blocks to mark them known live. // Update all dominating blocks to mark them known live.

View File

@ -163,8 +163,6 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
// Realize that the destination register is defined by the PHI copy now, not // Realize that the destination register is defined by the PHI copy now, not
// the PHI itself. // the PHI itself.
LV->getVarInfo(DestReg).DefInst = PHICopy; LV->getVarInfo(DestReg).DefInst = PHICopy;
LV->getVarInfo(IncomingReg).UsedBlocks[MBB.getNumber()] = true;
} }
// Adjust the VRegPHIUseCount map to account for the removal of this PHI // 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. // instruction kills the incoming value.
// //
LiveVariables::VarInfo &InRegVI = LV->getVarInfo(SrcReg); LiveVariables::VarInfo &InRegVI = LV->getVarInfo(SrcReg);
InRegVI.UsedBlocks[opBlock.getNumber()] = true;
// Loop over all of the successors of the basic block, checking to see // 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 // if the value is either live in the block, or if it is killed in the

View File

@ -197,10 +197,6 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
LiveVariables::VarInfo& varInfo = LV.getVarInfo(regA); LiveVariables::VarInfo& varInfo = LV.getVarInfo(regA);
varInfo.DefInst = prevMi; 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)) if (LV.removeVirtualRegisterKilled(regB, mbbi, mi))
LV.addVirtualRegisterKilled(regB, prevMi); LV.addVirtualRegisterKilled(regB, prevMi);