LLVM  8.0.1
Public Member Functions | List of all members
llvm::OptBisect Class Reference

This class implements a mechanism to disable passes and individual optimizations at compile time based on a command line option (-opt-bisect-limit) in order to perform a bisecting search for optimization-related problems. More...

#include "llvm/IR/OptBisect.h"

Inheritance diagram for llvm::OptBisect:
Inheritance graph
[legend]
Collaboration diagram for llvm::OptBisect:
Collaboration graph
[legend]

Public Member Functions

 OptBisect ()
 Default constructor, initializes the OptBisect state based on the -opt-bisect-limit command line argument. More...
 
virtual ~OptBisect ()=default
 
bool shouldRunPass (const Pass *P, const Module &U) override
 Checks the bisect limit to determine if the specified pass should run. More...
 
bool shouldRunPass (const Pass *P, const Function &U) override
 
bool shouldRunPass (const Pass *P, const BasicBlock &U) override
 
bool shouldRunPass (const Pass *P, const Region &U) override
 
bool shouldRunPass (const Pass *P, const Loop &U) override
 
bool shouldRunPass (const Pass *P, const CallGraphSCC &U) override
 
- Public Member Functions inherited from llvm::OptPassGate
virtual ~OptPassGate ()=default
 

Detailed Description

This class implements a mechanism to disable passes and individual optimizations at compile time based on a command line option (-opt-bisect-limit) in order to perform a bisecting search for optimization-related problems.

Definition at line 48 of file OptBisect.h.

Constructor & Destructor Documentation

◆ OptBisect()

OptBisect::OptBisect ( )

Default constructor, initializes the OptBisect state based on the -opt-bisect-limit command line argument.

By default, bisection is disabled.

Clients should not instantiate this class directly. All access should go through LLVMContext.

Definition at line 39 of file OptBisect.cpp.

References llvm::max(), and OptBisectLimit.

◆ ~OptBisect()

virtual llvm::OptBisect::~OptBisect ( )
virtualdefault

Member Function Documentation

◆ shouldRunPass() [1/6]

bool OptBisect::shouldRunPass ( const Pass P,
const Module U 
)
overridevirtual

Checks the bisect limit to determine if the specified pass should run.

These functions immediately return true if bisection is disabled. If the bisect limit is set to -1, the functions print a message describing the pass and the bisect number assigned to it and return true. Otherwise, the functions print a message with the bisect number assigned to the pass and indicating whether or not the pass will be run and return true if the bisect limit has not yet been exceeded or false if it has.

Most passes should not call these routines directly. Instead, they are called through helper routines provided by the pass base classes. For instance, function passes should call FunctionPass::skipFunction().

Reimplemented from llvm::OptPassGate.

Definition at line 95 of file OptBisect.cpp.

References getDescription(), and llvm::Pass::getPassName().

◆ shouldRunPass() [2/6]

bool OptBisect::shouldRunPass ( const Pass P,
const Function U 
)
overridevirtual

Reimplemented from llvm::OptPassGate.

Definition at line 99 of file OptBisect.cpp.

References getDescription(), and llvm::Pass::getPassName().

◆ shouldRunPass() [3/6]

bool OptBisect::shouldRunPass ( const Pass P,
const BasicBlock U 
)
overridevirtual

Reimplemented from llvm::OptPassGate.

Definition at line 103 of file OptBisect.cpp.

References getDescription(), and llvm::Pass::getPassName().

◆ shouldRunPass() [4/6]

bool OptBisect::shouldRunPass ( const Pass P,
const Region U 
)
overridevirtual

Reimplemented from llvm::OptPassGate.

Definition at line 107 of file OptBisect.cpp.

References getDescription(), and llvm::Pass::getPassName().

◆ shouldRunPass() [5/6]

bool OptBisect::shouldRunPass ( const Pass P,
const Loop U 
)
overridevirtual

Reimplemented from llvm::OptPassGate.

Definition at line 111 of file OptBisect.cpp.

References getDescription(), and llvm::Pass::getPassName().

◆ shouldRunPass() [6/6]

bool OptBisect::shouldRunPass ( const Pass P,
const CallGraphSCC U 
)
overridevirtual

Reimplemented from llvm::OptPassGate.

Definition at line 115 of file OptBisect.cpp.

References assert(), getDescription(), llvm::Pass::getPassName(), OptBisectLimit, and printPassMessage().


The documentation for this class was generated from the following files: