Index: llvm/lib/CodeGen/ReachingDefAnalysis.cpp =================================================================== --- llvm/lib/CodeGen/ReachingDefAnalysis.cpp +++ llvm/lib/CodeGen/ReachingDefAnalysis.cpp @@ -421,7 +421,9 @@ SmallPtrSet VisitedBBs; SmallPtrSet Incoming; - for (auto *Pred : MI->getParent()->predecessors()) + MachineBasicBlock *Parent = MI->getParent(); + VisitedBBs.insert(Parent); + for (auto *Pred : Parent->predecessors()) getLiveOuts(Pred, PhysReg, Incoming, VisitedBBs); // If we have a local def and an incoming instruction, then there's not a