summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-07-30 19:59:19 +0000
committerAndrew Trick <atrick@apple.com>2013-07-30 19:59:19 +0000
commitc7934b3e37bbe353579987407c7cd7b5f4d38787 (patch)
treeb12a6be3ef6ef3adf2f297e8c40733eb15582031 /llvm/include
parent9b866051e5bee2aa8e6b65392bc58f0311c3b377 (diff)
downloadbcm5719-llvm-c7934b3e37bbe353579987407c7cd7b5f4d38787.tar.gz
bcm5719-llvm-c7934b3e37bbe353579987407c7cd7b5f4d38787.zip
Down-scale slot index distance to save bits.
llvm-svn: 187438
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/CodeGen/SlotIndexes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/SlotIndexes.h b/llvm/include/llvm/CodeGen/SlotIndexes.h
index 1c7bdb2e586..984796af864 100644
--- a/llvm/include/llvm/CodeGen/SlotIndexes.h
+++ b/llvm/include/llvm/CodeGen/SlotIndexes.h
@@ -218,6 +218,13 @@ namespace llvm {
return other.getIndex() - getIndex();
}
+ /// Return the scaled distance from this index to the given one, where all
+ /// slots on the same instruction have zero distance.
+ int getInstrDistance(SlotIndex other) const {
+ return (other.listEntry()->getIndex() - listEntry()->getIndex())
+ / Slot_Count;
+ }
+
/// isBlock - Returns true if this is a block boundary slot.
bool isBlock() const { return getSlot() == Slot_Block; }
OpenPOWER on IntegriCloud