[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h MachineFunction.h
Chris Lattner
lattner at cs.uiuc.edu
Wed Sep 13 23:41:02 PDT 2006
Changes in directory llvm/include/llvm/CodeGen:
LiveIntervalAnalysis.h updated: 1.61 -> 1.62
MachineFunction.h updated: 1.60 -> 1.61
---
Log message:
Remove dead methods, add getNumBlockIDs() method
---
Diffs of the changes: (+25 -10)
LiveIntervalAnalysis.h | 26 +++++++++++++++++++++++---
MachineFunction.h | 9 ++-------
2 files changed, 25 insertions(+), 10 deletions(-)
Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.61 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.62
--- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.61 Sun Sep 3 03:07:11 2006
+++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Thu Sep 14 01:40:48 2006
@@ -38,6 +38,10 @@
const TargetInstrInfo* tii_;
LiveVariables* lv_;
+ /// MBB2IdxMap - The index of the first instruction in the specified basic
+ /// block.
+ std::vector<unsigned> MBB2IdxMap;
+
typedef std::map<MachineInstr*, unsigned> Mi2IndexMap;
Mi2IndexMap mi2iMap_;
@@ -113,6 +117,17 @@
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
unsigned getInstructionIndex(MachineInstr* instr) const {
Mi2IndexMap::const_iterator it = mi2iMap_.find(instr);
@@ -128,7 +143,7 @@
"index does not correspond to an instruction");
return i2miMap_[index];
}
-
+
std::vector<LiveInterval*> addIntervalsForSpills(const LiveInterval& i,
VirtRegMap& vrm,
int slot);
@@ -155,12 +170,17 @@
}
}
- /// computeIntervals - compute live intervals
- void computeIntervals();
+ /// computeIntervals - Compute live intervals. This returns a vector of all
+ /// the two-address instructions to the caller.
+ void computeIntervals(std::vector<MachineInstr*> &TwoAddrInsts);
/// joinIntervals - join compatible live intervals
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
/// copies that cannot yet be coallesced into the "TryAgain" list.
void CopyCoallesceInMBB(MachineBasicBlock *MBB,
Index: llvm/include/llvm/CodeGen/MachineFunction.h
diff -u llvm/include/llvm/CodeGen/MachineFunction.h:1.60 llvm/include/llvm/CodeGen/MachineFunction.h:1.61
--- llvm/include/llvm/CodeGen/MachineFunction.h:1.60 Thu Aug 17 17:00:07 2006
+++ llvm/include/llvm/CodeGen/MachineFunction.h Thu Sep 14 01:40:48 2006
@@ -223,13 +223,8 @@
return MBBNumbering[N];
}
- /// getLastBlock - Returns the MachineBasicBlock with the greatest number
- MachineBasicBlock *getLastBlock() {
- return MBBNumbering.back();
- }
- const MachineBasicBlock *getLastBlock() const {
- return MBBNumbering.back();
- }
+ /// getNumBlockIDs - Return the number of MBB ID's allocated.
+ unsigned getNumBlockIDs() const { return MBBNumbering.size(); }
/// print - Print out the MachineFunction in a format suitable for debugging
/// to the specified stream.
More information about the llvm-commits
mailing list