diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp index cce97fdb67d..bd164a30d9d 100644 --- a/lib/CodeGen/SplitKit.cpp +++ b/lib/CodeGen/SplitKit.cpp @@ -550,7 +550,7 @@ void LiveIntervalMap::addSimpleRange(SlotIndex Start, SlotIndex End, // ParentVNI is a complex value. We must map per MBB. MachineFunction::iterator MBB = lis_.getMBBFromIndex(Start); - MachineFunction::iterator MBBE = lis_.getMBBFromIndex(End); + MachineFunction::iterator MBBE = lis_.getMBBFromIndex(End.getPrevSlot()); if (MBB == MBBE) { li_->addRange(LiveRange(Start, End, VNI));