summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/SlotIndexes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/SlotIndexes.h')
-rw-r--r--include/llvm/CodeGen/SlotIndexes.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h
index 6c09526b59..d868cb8dad 100644
--- a/include/llvm/CodeGen/SlotIndexes.h
+++ b/include/llvm/CodeGen/SlotIndexes.h
@@ -19,7 +19,7 @@
#ifndef LLVM_CODEGEN_SLOTINDEXES_H
#define LLVM_CODEGEN_SLOTINDEXES_H
-#include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/CodeGen/MachineInstrBundle.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/ADT/PointerIntPair.h"
@@ -495,10 +495,7 @@ namespace llvm {
/// Returns the base index for the given instruction.
SlotIndex getInstructionIndex(const MachineInstr *MI) const {
// Instructions inside a bundle have the same number as the bundle itself.
- MachineBasicBlock::const_instr_iterator I = MI;
- while (I->isInsideBundle())
- --I;
- Mi2IndexMap::const_iterator itr = mi2iMap.find(I);
+ Mi2IndexMap::const_iterator itr = mi2iMap.find(getBundleStart(MI));
assert(itr != mi2iMap.end() && "Instruction not found in maps.");
return itr->second;
}