From: Alina Sbirlea Date: Wed, 6 Apr 2022 21:22:52 +0000 (-0700) Subject: [MSSA] Print memory phis when inspecting walker. X-Git-Tag: upstream/15.0.7~11226 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50d41f3e0daabdf990465aef70ae6eb626c4e879;p=platform%2Fupstream%2Fllvm.git [MSSA] Print memory phis when inspecting walker. This makes the MemorySSA and MemorySSA Walker printers consistent. Invokation `-print` should also have the MemoryPhis. --- diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index fc9de56..f63898b 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -130,6 +130,12 @@ public: MemorySSAWalkerAnnotatedWriter(MemorySSA *M) : MSSA(M), Walker(M->getWalker()) {} + void emitBasicBlockStartAnnot(const BasicBlock *BB, + formatted_raw_ostream &OS) override { + if (MemoryAccess *MA = MSSA->getMemoryAccess(BB)) + OS << "; " << *MA << "\n"; + } + void emitInstructionAnnot(const Instruction *I, formatted_raw_ostream &OS) override { if (MemoryAccess *MA = MSSA->getMemoryAccess(I)) {