Skip to content

[llvm][Support] Enable pass timing in StandardInstrumentations constr… #108983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion llvm/include/llvm/Passes/StandardInstrumentations.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,9 @@ class StandardInstrumentations {
public:
StandardInstrumentations(LLVMContext &Context, bool DebugLogging,
bool VerifyEach = false,
PrintPassOptions PrintPassOpts = PrintPassOptions());
PrintPassOptions PrintPassOpts = PrintPassOptions(),
bool EnableTimePasses = false,
bool EnableTimePassesPerRun = false);

// Register all the standard instrumentation callbacks. If \p FAM is nullptr
// then PreservedCFGChecker is not enabled.
Expand Down
8 changes: 5 additions & 3 deletions llvm/lib/Passes/StandardInstrumentations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2442,10 +2442,12 @@ void DotCfgChangeReporter::registerCallbacks(

StandardInstrumentations::StandardInstrumentations(
LLVMContext &Context, bool DebugLogging, bool VerifyEach,
PrintPassOptions PrintPassOpts)
PrintPassOptions PrintPassOpts, bool EnableTimePasses,
bool EnableTimePassesPerRun)
: PrintPass(DebugLogging, PrintPassOpts),
OptNone(DebugLogging),
OptPassGate(Context),
TimePasses(TimePassesIsEnabled ? TimePassesIsEnabled : EnableTimePasses,
TimePassesPerRun ? TimePassesPerRun : EnableTimePassesPerRun),
OptNone(DebugLogging), OptPassGate(Context),
PrintChangedIR(PrintChanged == ChangePrinter::Verbose),
PrintChangedDiff(PrintChanged == ChangePrinter::DiffVerbose ||
PrintChanged == ChangePrinter::ColourDiffVerbose,
Expand Down
Loading