LLVM  6.0.0svn
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"

Public Member Functions

 OptBisect ()
 Default constructor, initializes the OptBisect state based on the -opt-bisect-limit command line argument. More...
 
template<class UnitT >
bool shouldRunPass (const Pass *P, const UnitT &U)
 Checks the bisect limit to determine if the specified pass should run. More...
 

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 28 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.

Member Function Documentation

◆ shouldRunPass()

template<class UnitT >
bool OptBisect::shouldRunPass ( const Pass P,
const UnitT &  U 
)

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

This function will immediate return true if bisection is disabled. If the bisect limit is set to -1, the function will print a message describing the pass and the bisect number assigned to it and return true. Otherwise, the function will 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 exceded or false if it has.

Most passes should not call this routine directly. Instead, it is called through a helper routine provided by the pass base class. For instance, function passes should call FunctionPass::skipFunction().

Definition at line 104 of file OptBisect.cpp.

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

Referenced by getDescription(), llvm::BasicBlockPass::skipBasicBlock(), llvm::FunctionPass::skipFunction(), llvm::LoopPass::skipLoop(), llvm::ModulePass::skipModule(), llvm::RegionPass::skipRegion(), and llvm::CallGraphSCCPass::skipSCC().


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