Remove dead methods, add getNumBlockIDs() method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30322 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-09-14 06:40:48 +00:00
parent 5f1d01393c
commit 2540813e5d
2 changed files with 25 additions and 10 deletions

View File

@ -38,6 +38,10 @@ namespace llvm {
const TargetInstrInfo* tii_; const TargetInstrInfo* tii_;
LiveVariables* lv_; LiveVariables* lv_;
/// MBB2IdxMap - The index of the first instruction in the specified basic
/// block.
std::vector<unsigned> MBB2IdxMap;
typedef std::map<MachineInstr*, unsigned> Mi2IndexMap; typedef std::map<MachineInstr*, unsigned> Mi2IndexMap;
Mi2IndexMap mi2iMap_; Mi2IndexMap mi2iMap_;
@ -113,6 +117,17 @@ namespace llvm {
return I->second; return I->second;
} }
/// getMBBStartIdx - Return the base index of the first instruction in the
/// specified MachineBasicBlock.
unsigned getMBBStartIdx(MachineBasicBlock *MBB) const {
return getMBBStartIdx(MBB->getNumber());
}
unsigned getMBBStartIdx(unsigned MBBNo) const {
assert(MBBNo < MBB2IdxMap.size() && "Invalid MBB number!");
return MBB2IdxMap[MBBNo];
}
/// getInstructionIndex - returns the base index of instr /// getInstructionIndex - returns the base index of instr
unsigned getInstructionIndex(MachineInstr* instr) const { unsigned getInstructionIndex(MachineInstr* instr) const {
Mi2IndexMap::const_iterator it = mi2iMap_.find(instr); Mi2IndexMap::const_iterator it = mi2iMap_.find(instr);
@ -128,7 +143,7 @@ namespace llvm {
"index does not correspond to an instruction"); "index does not correspond to an instruction");
return i2miMap_[index]; return i2miMap_[index];
} }
std::vector<LiveInterval*> addIntervalsForSpills(const LiveInterval& i, std::vector<LiveInterval*> addIntervalsForSpills(const LiveInterval& i,
VirtRegMap& vrm, VirtRegMap& vrm,
int slot); int slot);
@ -155,12 +170,17 @@ namespace llvm {
} }
} }
/// computeIntervals - compute live intervals /// computeIntervals - Compute live intervals. This returns a vector of all
void computeIntervals(); /// the two-address instructions to the caller.
void computeIntervals(std::vector<MachineInstr*> &TwoAddrInsts);
/// joinIntervals - join compatible live intervals /// joinIntervals - join compatible live intervals
void joinIntervals(); void joinIntervals();
/// HandleTwoAddressInsts - Arrange for the specified list of 2-addr
/// instructions to have their src/dst regs allocated to the same register.
void HandleTwoAddressInsts(const std::vector<MachineInstr*> &TwoAddrInsts);
/// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting /// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting
/// copies that cannot yet be coallesced into the "TryAgain" list. /// copies that cannot yet be coallesced into the "TryAgain" list.
void CopyCoallesceInMBB(MachineBasicBlock *MBB, void CopyCoallesceInMBB(MachineBasicBlock *MBB,

View File

@ -223,13 +223,8 @@ public:
return MBBNumbering[N]; return MBBNumbering[N];
} }
/// getLastBlock - Returns the MachineBasicBlock with the greatest number /// getNumBlockIDs - Return the number of MBB ID's allocated.
MachineBasicBlock *getLastBlock() { unsigned getNumBlockIDs() const { return MBBNumbering.size(); }
return MBBNumbering.back();
}
const MachineBasicBlock *getLastBlock() const {
return MBBNumbering.back();
}
/// print - Print out the MachineFunction in a format suitable for debugging /// print - Print out the MachineFunction in a format suitable for debugging
/// to the specified stream. /// to the specified stream.