mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Skip a binary search when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129293 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -545,6 +545,8 @@ namespace llvm {
|
|||||||
|
|
||||||
/// Returns the basic block which the given index falls in.
|
/// Returns the basic block which the given index falls in.
|
||||||
MachineBasicBlock* getMBBFromIndex(SlotIndex index) const {
|
MachineBasicBlock* getMBBFromIndex(SlotIndex index) const {
|
||||||
|
if (MachineInstr *MI = getInstructionFromIndex(index))
|
||||||
|
return MI->getParent();
|
||||||
SmallVectorImpl<IdxMBBPair>::const_iterator I =
|
SmallVectorImpl<IdxMBBPair>::const_iterator I =
|
||||||
std::lower_bound(idx2MBBMap.begin(), idx2MBBMap.end(), index);
|
std::lower_bound(idx2MBBMap.begin(), idx2MBBMap.end(), index);
|
||||||
// Take the pair containing the index
|
// Take the pair containing the index
|
||||||
|
Reference in New Issue
Block a user