Index: llvm/lib/CodeGen/MachineVerifier.cpp =================================================================== --- llvm/lib/CodeGen/MachineVerifier.cpp +++ llvm/lib/CodeGen/MachineVerifier.cpp @@ -2264,10 +2264,13 @@ } // Iteratively push vregsPassed to successors. + DenseSet Visited; while (!RPOWorklist.empty()) { auto Next = RPOWorklist.begin(); const MachineBasicBlock *MBB = Next->second; RPOWorklist.erase(Next); + if (!Visited.insert(MBB).second) + continue; FilteringVRegSet &MSet = VRegsPassedSets[RPONumbers[MBB]]; for (const MachineBasicBlock *Succ : MBB->successors()) { if (Succ == MBB)