aboutsummaryrefslogtreecommitdiffstats
path: root/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
commitc0173e6f9f0de4497cd9b52b4f2269a57846f2ac (patch)
tree75a16b946f1b843b9c2cfbbccf55d5cddc94ad82 /include
parentc0c9205811a6957ab04ebe4a0fc84f3563b0c9da (diff)
downloadexternal_llvm-c0173e6f9f0de4497cd9b52b4f2269a57846f2ac.zip
external_llvm-c0173e6f9f0de4497cd9b52b4f2269a57846f2ac.tar.gz
external_llvm-c0173e6f9f0de4497cd9b52b4f2269a57846f2ac.tar.bz2
Down-scale slot index distance to save bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/SlotIndexes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h
index 1c7bdb2..984796a 100644
--- a/include/llvm/CodeGen/SlotIndexes.h
+++ b/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; }