[PATCH] D145015: [PassBuilder] Always enable CountVisitsPass when stats are enabled
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 1 09:22:22 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG25af6507e773: [PassBuilder] Always enable CountVisitsPass when stats are enabled (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145015/new/
https://reviews.llvm.org/D145015
Files:
llvm/lib/Passes/PassBuilderPipelines.cpp
llvm/test/Other/count-visits.ll
Index: llvm/test/Other/count-visits.ll
===================================================================
--- llvm/test/Other/count-visits.ll
+++ llvm/test/Other/count-visits.ll
@@ -2,8 +2,8 @@
; RUN: opt -passes=count-visits -stats 2>&1 -disable-output < %s | FileCheck %s --check-prefix=ONE
; RUN: opt -passes='cgscc(count-visits)' -stats 2>&1 -disable-output < %s | FileCheck %s --check-prefix=ONE
; RUN: opt -passes='cgscc(count-visits,instcombine)' -stats 2>&1 -disable-output < %s | FileCheck %s --check-prefix=TWO
-; RUN: opt -passes='default<O1>' -count-cgscc-max-visits -stats 2>&1 -disable-output < %s | FileCheck %s --check-prefix=PIPELINE
-; RUN: opt -passes='default<O3>' -count-cgscc-max-visits -stats 2>&1 -disable-output < %s | FileCheck %s --check-prefix=PIPELINE
+; RUN: opt -passes='default<O1>' -stats 2>&1 -disable-output < %s | FileCheck %s --check-prefix=PIPELINE
+; RUN: opt -passes='default<O3>' -stats 2>&1 -disable-output < %s | FileCheck %s --check-prefix=PIPELINE
; ONE: 1 count-visits - Max number of times we visited a function
; TWO: 2 count-visits - Max number of times we visited a function
Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -14,6 +14,7 @@
///
//===----------------------------------------------------------------------===//
+#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/BasicAliasAnalysis.h"
#include "llvm/Analysis/CGSCCPassManager.h"
@@ -253,11 +254,6 @@
EnableMatrix("enable-matrix", cl::init(false), cl::Hidden,
cl::desc("Enable lowering of the matrix intrinsics"));
-static cl::opt<bool> CountCGSCCVisits(
- "count-cgscc-max-visits", cl::init(false), cl::Hidden,
- cl::desc("Keep track of the max number of times we visit a function in the "
- "CGSCC pipeline as a statistic"));
-
static cl::opt<bool> EnableConstraintElimination(
"enable-constraint-elimination", cl::init(true), cl::Hidden,
cl::desc(
@@ -318,7 +314,7 @@
FunctionPassManager FPM;
- if (CountCGSCCVisits)
+ if (AreStatisticsEnabled())
FPM.addPass(CountVisitsPass());
// Form SSA out of local memory accesses after breaking apart aggregates into
@@ -471,7 +467,7 @@
FunctionPassManager FPM;
- if (CountCGSCCVisits)
+ if (AreStatisticsEnabled())
FPM.addPass(CountVisitsPass());
// Form SSA out of local memory accesses after breaking apart aggregates into
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145015.501549.patch
Type: text/x-patch
Size: 2594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230301/1f3fef7e/attachment.bin>
More information about the llvm-commits
mailing list