[llvm] 50d41f3 - [MSSA] Print memory phis when inspecting walker.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 16:07:03 PDT 2022


Author: Alina Sbirlea
Date: 2022-04-06T16:06:14-07:00
New Revision: 50d41f3e0daabdf990465aef70ae6eb626c4e879

URL: https://github.com/llvm/llvm-project/commit/50d41f3e0daabdf990465aef70ae6eb626c4e879
DIFF: https://github.com/llvm/llvm-project/commit/50d41f3e0daabdf990465aef70ae6eb626c4e879.diff

LOG: [MSSA] Print memory phis when inspecting walker.

This makes the MemorySSA and MemorySSA Walker printers consistent.
Invokation `-print<memoryssa-walker>` should also have the MemoryPhis.

Added: 
    

Modified: 
    llvm/lib/Analysis/MemorySSA.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp
index fc9de56a5e5b8..f63898be31735 100644
--- a/llvm/lib/Analysis/MemorySSA.cpp
+++ b/llvm/lib/Analysis/MemorySSA.cpp
@@ -130,6 +130,12 @@ class MemorySSAWalkerAnnotatedWriter : public AssemblyAnnotationWriter {
   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)) {


        


More information about the llvm-commits mailing list