projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d73c7d
)
Skip a binary search when possible.
author
Jakob Stoklund Olesen
<stoklund@2pi.dk>
Mon, 11 Apr 2011 20:01:44 +0000
(20:01 +0000)
committer
Jakob Stoklund Olesen
<stoklund@2pi.dk>
Mon, 11 Apr 2011 20:01:44 +0000
(20:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129293
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/CodeGen/SlotIndexes.h
patch
|
blob
|
history
diff --git
a/include/llvm/CodeGen/SlotIndexes.h
b/include/llvm/CodeGen/SlotIndexes.h
index dc247132c8f238f7a478e148caa3948b070e837e..7bbb7521e54a7ed3d697ea03f55b145f4af1aae2 100644
(file)
--- a/
include/llvm/CodeGen/SlotIndexes.h
+++ b/
include/llvm/CodeGen/SlotIndexes.h
@@
-545,6
+545,8
@@
namespace llvm {
/// Returns the basic block which the given index falls in.
MachineBasicBlock* getMBBFromIndex(SlotIndex index) const {
+ if (MachineInstr *MI = getInstructionFromIndex(index))
+ return MI->getParent();
SmallVectorImpl<IdxMBBPair>::const_iterator I =
std::lower_bound(idx2MBBMap.begin(), idx2MBBMap.end(), index);
// Take the pair containing the index