class TimePassesHandler

Declaration

class TimePassesHandler { /* full declaration omitted */ };

Description

This class implements -time-passes functionality for new pass manager. It provides the pass-instrumentation callbacks that measure the pass execution time. They collect timing info into individual timers as passes are being run. At the end of its life-time it prints the resulting timing report.

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:44

Member Variables

private llvm::TimerGroup TG
A group of all pass-timing timers.
private StringMap<llvm::TimePassesHandler::TimerVector> TimingData
Map of timers for pass invocations
private SmallVector<llvm::Timer*, 8> TimerStack
Stack of currently active timers.
private llvm::raw_ostream* OutStream = nullptr
Custom output stream to print timing information into. By default (== nullptr) we emit time report into the stream created by CreateInfoOutputFile().
private bool Enabled
private bool PerRun

Method Overview

Methods

TimePassesHandler()

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:69

TimePassesHandler(bool Enabled,
                  bool PerRun = false)

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:70

Parameters

bool Enabled
bool PerRun = false

TimePassesHandler(const llvm::TimePassesHandler&)

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:79

Parameters

const llvm::TimePassesHandler&

void dump() const

Description

Dumps information for running/triggered timers, useful for debugging

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:89

llvm::Timer& getPassTimer(llvm::StringRef PassID)

Description

Returns the new timer for each new run of the pass.

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:92

Parameters

llvm::StringRef PassID

void print()

Description

Prints out timing information and then resets the timers.

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:76

void registerCallbacks(
    llvm::PassInstrumentationCallbacks& PIC)

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:82

Parameters

llvm::PassInstrumentationCallbacks& PIC

void runAfterPass(llvm::StringRef PassID)

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:99

Parameters

llvm::StringRef PassID

void runBeforePass(llvm::StringRef PassID)

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:98

Parameters

llvm::StringRef PassID

void setOutStream(llvm::raw_ostream& OutStream)

Description

Set a custom output stream for subsequent reporting.

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:85

Parameters

llvm::raw_ostream& OutStream

void startTimer(llvm::StringRef PassID)

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:94

Parameters

llvm::StringRef PassID

void stopTimer(llvm::StringRef PassID)

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:95

Parameters

llvm::StringRef PassID

~TimePassesHandler()

Description

Destructor handles the print action if it has not been handled before.

Declared at: llvm/include/llvm/IR/PassTimingInfo.h:73