summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/SlotIndexes.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-04-05 15:18:18 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-04-05 15:18:18 +0000
commita2948ef5accab638371615f539ea9f9ec5ff5d03 (patch)
tree7094173d4feae4d1449a703725736e37243498a0 /include/llvm/CodeGen/SlotIndexes.h
parent0286ca89f0734a81c273e80732a573f619c7ace4 (diff)
downloadllvm-a2948ef5accab638371615f539ea9f9ec5ff5d03.tar.gz
llvm-a2948ef5accab638371615f539ea9f9ec5ff5d03.tar.bz2
llvm-a2948ef5accab638371615f539ea9f9ec5ff5d03.tar.xz
Use std::unique instead of a SmallPtrSet to ensure unique instructions in UseSlots.
This allows us to always keep the smaller slot for an instruction which is what we want when a register has early clobber defines. Drop the UsingInstrs set and the UsingBlocks map. They are no longer needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SlotIndexes.h')
-rw-r--r--include/llvm/CodeGen/SlotIndexes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h
index 7cc31563b6..dc247132c8 100644
--- a/include/llvm/CodeGen/SlotIndexes.h
+++ b/include/llvm/CodeGen/SlotIndexes.h
@@ -178,6 +178,11 @@ namespace llvm {
return getIndex() >= other.getIndex();
}
+ /// isSameInstr - Return true if A and B refer to the same instruction.
+ static bool isSameInstr(SlotIndex A, SlotIndex B) {
+ return A.lie.getPointer() == B.lie.getPointer();
+ }
+
/// Return the distance from this index to the given one.
int distance(SlotIndex other) const {
return other.getIndex() - getIndex();