Skip to content

Commit 14dfdc0

Browse files
authored
[OptBisect] Add an option to disable print of pass message (#101065)
The print could take a huge amount of time if there are millions of optimization passes running. This patch simply adds an option to disable the print.
1 parent 8d28d44 commit 14dfdc0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/IR/OptBisect.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ static cl::opt<int> OptBisectLimit("opt-bisect-limit", cl::Hidden,
3232
}),
3333
cl::desc("Maximum optimization to perform"));
3434

35+
static cl::opt<bool> OptBisectVerbose(
36+
"opt-bisect-verbose",
37+
cl::desc("Show verbose output when opt-bisect-limit is set"), cl::Hidden,
38+
cl::init(true), cl::Optional);
39+
3540
static void printPassMessage(const StringRef &Name, int PassNum,
3641
StringRef TargetDesc, bool Running) {
3742
StringRef Status = Running ? "" : "NOT ";
@@ -45,7 +50,8 @@ bool OptBisect::shouldRunPass(const StringRef PassName,
4550

4651
int CurBisectNum = ++LastBisectNum;
4752
bool ShouldRun = (BisectLimit == -1 || CurBisectNum <= BisectLimit);
48-
printPassMessage(PassName, CurBisectNum, IRDescription, ShouldRun);
53+
if (OptBisectVerbose)
54+
printPassMessage(PassName, CurBisectNum, IRDescription, ShouldRun);
4955
return ShouldRun;
5056
}
5157

0 commit comments

Comments
 (0)