Index: lib/CodeGen/LiveDebugValues.cpp =================================================================== --- lib/CodeGen/LiveDebugValues.cpp +++ lib/CodeGen/LiveDebugValues.cpp @@ -672,9 +672,16 @@ /*transferSpills=*/true); // Add any DBG_VALUE instructions necessitated by spills. - for (auto &SP : Spills) - MBB->insertAfter(MachineBasicBlock::iterator(*SP.SpillInst), - SP.DebugInst); + for (auto &SP : Spills){ + MachineInstr *InsertPoint = SP.SpillInst; + MachineInstr *DebugInst = SP.DebugInst; + MBB->insertAfter(MachineBasicBlock::iterator(*InsertPoint), + DebugInst); + if (InsertPoint->isBundledWithSucc()){ + DebugInst->setFlag(MachineInstr::BundledSucc); + DebugInst->setFlag(MachineInstr::BundledPred); + } + } Spills.clear(); DEBUG(printVarLocInMBB(MF, OutLocs, VarLocIDs,