diff --git a/lib/Analysis/MemDepPrinter.cpp b/lib/Analysis/MemDepPrinter.cpp index 841f4b6b4ad..597daff8db2 100644 --- a/lib/Analysis/MemDepPrinter.cpp +++ b/lib/Analysis/MemDepPrinter.cpp @@ -150,7 +150,10 @@ void MemDepPrinter::print(raw_ostream &OS, const Module *M) const { WriteAsOperand(OS, DepBB, /*PrintType=*/false, M); } OS << " from: "; - DepInst->print(OS); + if (DepInst == Inst) + OS << ""; + else + DepInst->print(OS); OS << "\n"; }