Index: llvm/lib/CodeGen/MachineBasicBlock.cpp =================================================================== --- llvm/lib/CodeGen/MachineBasicBlock.cpp +++ llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -154,6 +154,8 @@ void ilist_traits::deleteNode(MachineInstr *MI) { assert(!MI->getParent() && "MI is still in a block!"); + if (MI->isCandidateForCallSiteEntry()) + Parent->getParent()->eraseCallSiteInfo(MI); Parent->getParent()->DeleteMachineInstr(MI); } Index: llvm/lib/CodeGen/MachineFunction.cpp =================================================================== --- llvm/lib/CodeGen/MachineFunction.cpp +++ llvm/lib/CodeGen/MachineFunction.cpp @@ -393,7 +393,7 @@ // be triggered during the implementation of support for the // call site info of a new architecture. If the assertion is triggered, // back trace will tell where to insert a call to updateCallSiteInfo(). - assert((!MI->isCall(MachineInstr::IgnoreBundle) || + assert((!MI->isCandidateForCallSiteEntry() || CallSitesInfo.find(MI) == CallSitesInfo.end()) && "Call site info was not updated!"); // Strip it for parts. The operand array and the MI object itself are