diff --git a/lib/CodeGen/RegAllocBasic.cpp b/lib/CodeGen/RegAllocBasic.cpp index af7da53b89b..dd5049898d9 100644 --- a/lib/CodeGen/RegAllocBasic.cpp +++ b/lib/CodeGen/RegAllocBasic.cpp @@ -429,7 +429,7 @@ void RegAllocBase::addMBBLiveIns(MachineFunction *MF) { if (!MBB->isLiveIn(PhysReg)) MBB->addLiveIn(PhysReg); } else if (SI.start() > Stop) - MBB = Indexes->getMBBFromIndex(SI.start()); + MBB = Indexes->getMBBFromIndex(SI.start().getPrevIndex()); if (++MBB == MFE) break; tie(Start, Stop) = Indexes->getMBBRange(MBB);