[PATCH] D137976: GlobalISel: Add debug print for applied rule in generated combiner

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 12:43:06 PST 2022


arsenm created this revision.
arsenm added reviewers: aemerson, paquette, dsanders, Pierre-vh.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

https://reviews.llvm.org/D137976

Files:
  llvm/utils/TableGen/GICombinerEmitter.cpp


Index: llvm/utils/TableGen/GICombinerEmitter.cpp
===================================================================
--- llvm/utils/TableGen/GICombinerEmitter.cpp
+++ llvm/utils/TableGen/GICombinerEmitter.cpp
@@ -823,16 +823,19 @@
          << Indent << "      "
          << CodeExpander(Rule->getMatchingFixupCode()->getValue(), Expansions,
                          RuleDef.getLoc(), ShowExpansions)
-         << "\n"
+         << '\n'
          << Indent << "      return true;\n"
          << Indent << "  }()";
     }
     OS << Indent << "     ) {\n" << Indent << "   ";
 
     if (const StringInit *Code = dyn_cast<StringInit>(Applyer->getArg(0))) {
-      OS << CodeExpander(Code->getAsUnquotedString(), Expansions,
+      OS << "    LLVM_DEBUG(dbgs() << \"Applying rule '"
+         << RuleDef.getName()
+         << "'\\n\");\n"
+         << CodeExpander(Code->getAsUnquotedString(), Expansions,
                          RuleDef.getLoc(), ShowExpansions)
-         << "\n"
+         << '\n'
          << Indent << "    return true;\n"
          << Indent << "  }\n";
     } else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137976.475246.patch
Type: text/x-patch
Size: 1093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221114/8a078e36/attachment.bin>


More information about the llvm-commits mailing list