summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2009-09-12 04:54:18 +0000
committerLang Hames <lhames@gmail.com>2009-09-12 04:54:18 +0000
commit4a39ba992677ce48c61cbdad02594d9737eabdf0 (patch)
tree2515f5aa623041171cc97ea53c2bbcd04864157b /include
parent35f291d2c5f80e8e713704190230064311bbbbbe (diff)
downloadllvm-4a39ba992677ce48c61cbdad02594d9737eabdf0.tar.gz
llvm-4a39ba992677ce48c61cbdad02594d9737eabdf0.tar.bz2
llvm-4a39ba992677ce48c61cbdad02594d9737eabdf0.tar.xz
Whoops. Committed the headers for r81605 - 'Moved some more index operations over to LiveIntervals.'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h8
-rw-r--r--include/llvm/CodeGen/LiveIntervalAnalysis.h24
2 files changed, 15 insertions, 17 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index 2a8c2c8841..f61a442a06 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -155,25 +155,25 @@ namespace llvm {
index |= PHI_BIT;
}
- MachineInstrIndex nextSlot() const {
+ MachineInstrIndex nextSlot_() const {
assert((index & PHI_BIT) == ((index + 1) & PHI_BIT) &&
"Index out of bounds.");
return MachineInstrIndex(index + 1);
}
- MachineInstrIndex nextIndex() const {
+ MachineInstrIndex nextIndex_() const {
assert((index & PHI_BIT) == ((index + NUM) & PHI_BIT) &&
"Index out of bounds.");
return MachineInstrIndex(index + NUM);
}
- MachineInstrIndex prevSlot() const {
+ MachineInstrIndex prevSlot_() const {
assert((index & PHI_BIT) == ((index - 1) & PHI_BIT) &&
"Index out of bounds.");
return MachineInstrIndex(index - 1);
}
- MachineInstrIndex prevIndex() const {
+ MachineInstrIndex prevIndex_() const {
assert((index & PHI_BIT) == ((index - NUM) & PHI_BIT) &&
"Index out of bounds.");
return MachineInstrIndex(index - NUM);
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h
index 3ab73f8496..337ec1ce96 100644
--- a/include/llvm/CodeGen/LiveIntervalAnalysis.h
+++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h
@@ -122,24 +122,22 @@ namespace llvm {
}
MachineInstrIndex getStoreIndex(MachineInstrIndex index) {
return MachineInstrIndex(index, MachineInstrIndex::STORE);
- }
-
-
+ }
MachineInstrIndex getNextSlot(MachineInstrIndex m) const {
- return m.nextSlot();
+ return m.nextSlot_();
}
MachineInstrIndex getNextIndex(MachineInstrIndex m) const {
- return m.nextIndex();
+ return m.nextIndex_();
}
MachineInstrIndex getPrevSlot(MachineInstrIndex m) const {
- return m.prevSlot();
+ return m.prevSlot_();
}
MachineInstrIndex getPrevIndex(MachineInstrIndex m) const {
- return m.prevIndex();
+ return m.prevIndex_();
}
static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
@@ -240,14 +238,14 @@ namespace llvm {
/// hasGapBeforeInstr - Return true if the previous instruction slot,
/// i.e. Index - InstrSlots::NUM, is not occupied.
bool hasGapBeforeInstr(MachineInstrIndex Index) {
- Index = getBaseIndex(Index.prevIndex());
+ Index = getBaseIndex(getPrevIndex(Index));
return getInstructionFromIndex(Index) == 0;
}
/// hasGapAfterInstr - Return true if the successive instruction slot,
/// i.e. Index + InstrSlots::Num, is not occupied.
bool hasGapAfterInstr(MachineInstrIndex Index) {
- Index = getBaseIndex(Index.nextIndex());
+ Index = getBaseIndex(getNextIndex(Index));
return getInstructionFromIndex(Index) == 0;
}
@@ -256,15 +254,15 @@ namespace llvm {
/// away from the index (but before any index that's occupied).
MachineInstrIndex findGapBeforeInstr(MachineInstrIndex Index,
bool Furthest = false) {
- Index = getBaseIndex(Index.prevIndex());
+ Index = getBaseIndex(getPrevIndex(Index));
if (getInstructionFromIndex(Index))
return MachineInstrIndex(); // No gap!
if (!Furthest)
return Index;
- MachineInstrIndex PrevIndex = getBaseIndex(Index.prevIndex());
+ MachineInstrIndex PrevIndex = getBaseIndex(getPrevIndex(Index));
while (getInstructionFromIndex(Index)) {
Index = PrevIndex;
- PrevIndex = getBaseIndex(Index.prevIndex());
+ PrevIndex = getBaseIndex(getPrevIndex(Index));
}
return Index;
}
@@ -272,7 +270,7 @@ namespace llvm {
/// InsertMachineInstrInMaps - Insert the specified machine instruction
/// into the instruction index map at the given index.
void InsertMachineInstrInMaps(MachineInstr *MI, MachineInstrIndex Index) {
- i2miMap_[Index.index / MachineInstrIndex::NUM] = MI;
+ i2miMap_[Index.getVecIndex()] = MI;
Mi2IndexMap::iterator it = mi2iMap_.find(MI);
assert(it == mi2iMap_.end() && "Already in map!");
mi2iMap_[MI] = Index;