[PATCH] D152122: Set isRequired true for CFGViewer/CFGPrinter passes

Bing Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 23:21:02 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGae32ba4e015b: Set isRequired true for CFGViewer/CFGPrinter passes (authored by wenju, committed by yubing).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152122

Files:
  llvm/include/llvm/Analysis/CFGPrinter.h
  llvm/test/Other/cfg-printer-filter.ll


Index: llvm/test/Other/cfg-printer-filter.ll
===================================================================
--- llvm/test/Other/cfg-printer-filter.ll
+++ llvm/test/Other/cfg-printer-filter.ll
@@ -1,6 +1,8 @@
 ; RUN: rm -f %t.other.dot %t-only.other.dot
 
 ;; Both f and func are dumped because their names contain the pattern 'f' as a substring.
+;; Also checks dot-cfg pass runs on func which has optnone attribute.
+
 ; RUN: opt < %s -passes=dot-cfg -cfg-dot-filename-prefix=%t -cfg-func-name=f 2>/dev/null > /dev/null
 ; RUN: FileCheck %s -input-file=%t.f.dot -check-prefix=F
 ; RUN: FileCheck %s -input-file=%t.func.dot -check-prefix=Func
@@ -23,7 +25,7 @@
 }
 
 ; Func: digraph "CFG for 'func' function"
-define void @func(i32) {
+define void @func(i32) optnone noinline {
 entry:
   %check = icmp sgt i32 %0, 0
   br label %exit
Index: llvm/include/llvm/Analysis/CFGPrinter.h
===================================================================
--- llvm/include/llvm/Analysis/CFGPrinter.h
+++ llvm/include/llvm/Analysis/CFGPrinter.h
@@ -35,21 +35,25 @@
 class CFGViewerPass : public PassInfoMixin<CFGViewerPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+  static bool isRequired() { return true; }
 };
 
 class CFGOnlyViewerPass : public PassInfoMixin<CFGOnlyViewerPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+  static bool isRequired() { return true; }
 };
 
 class CFGPrinterPass : public PassInfoMixin<CFGPrinterPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+  static bool isRequired() { return true; }
 };
 
 class CFGOnlyPrinterPass : public PassInfoMixin<CFGOnlyPrinterPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+  static bool isRequired() { return true; }
 };
 
 class DOTFuncInfo {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152122.529175.patch
Type: text/x-patch
Size: 1860 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230607/2f682645/attachment.bin>


More information about the llvm-commits mailing list