[PATCH] D133709: -dot-machine-cfg for printing MachineFunction to a dot file

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 10:43:39 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/MachineCFGPrinter.h:130
+    else
+      return getCompleteNodeLabel(Node, CFGInfo);
+  }
----------------
No else after return


================
Comment at: llvm/lib/CodeGen/MachineCFGPrinter.cpp:2
+//===- MachineCFGPrinter.cpp - Pass to print machine function to a dot file
+//--===//
+//
----------------
Don't wrap this line


================
Comment at: llvm/lib/CodeGen/MachineCFGPrinter.cpp:23-26
+static cl::opt<std::string>
+    MCFGFuncName("mcfg-func-name", cl::Hidden,
+                 cl::desc("The name of a function (or its substring)"
+                          " whose CFG is viewed/printed."));
----------------
Could we reuse the same option names?


================
Comment at: llvm/lib/CodeGen/MachineCFGPrinter.cpp:50
+    errs() << "  error opening file for writing!";
+  errs() << "\n";
+}
----------------
Single quote


================
Comment at: llvm/test/Analysis/DotMachineCFG/AMDGPU/irreducible.mir:10-25
+  ; MCFG-LABEL: name: irreducible
+  ; MCFG: bb.0:
+  ; MCFG-NEXT:   successors: %bb.1(0x40000000), %bb.2(0x40000000)
+  ; MCFG-NEXT:   liveins: $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11, $sgpr14, $sgpr15, $sgpr16
+  ; MCFG-NEXT: {{  $}}
+  ; MCFG-NEXT:   [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF
+  ; MCFG-NEXT:   [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
----------------
I don't see any point in checking the MIR output here. Check the dot output if anything


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133709/new/

https://reviews.llvm.org/D133709



More information about the llvm-commits mailing list