[PATCH] D114310: Added check for "-filter-print-funcs" option to the region IR dumps.

Konstantin Pyzhov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 20 19:28:21 PST 2021


kpyzhov updated this revision to Diff 388739.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114310

Files:
  llvm/lib/Analysis/RegionPass.cpp


Index: llvm/lib/Analysis/RegionPass.cpp
===================================================================
--- llvm/lib/Analysis/RegionPass.cpp
+++ llvm/lib/Analysis/RegionPass.cpp
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 #include "llvm/Analysis/RegionPass.h"
 #include "llvm/IR/OptBisect.h"
+#include "llvm/IR/PrintPasses.h"
 #include "llvm/IR/PassTimingInfo.h"
 #include "llvm/IR/StructuralHash.h"
 #include "llvm/Support/Debug.h"
@@ -187,12 +188,14 @@
   }
 
   bool runOnRegion(Region *R, RGPassManager &RGM) override {
-    Out << Banner;
-    for (const auto *BB : R->blocks()) {
-      if (BB)
-        BB->print(Out);
-      else
-        Out << "Printing <null> Block";
+    if (isFunctionInPrintList(R->getEntry()->getParent()->getName())) {
+      Out << Banner;
+      for (const auto *BB : R->blocks()) {
+        if (BB)
+          BB->print(Out);
+        else
+          Out << "Printing <null> Block";
+      }
     }
 
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114310.388739.patch
Type: text/x-patch
Size: 1017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211121/b5cbd517/attachment.bin>


More information about the llvm-commits mailing list