Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-commit optimization bisect support (r267022) without new pass mana…
…ger support. The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the OptBisect handling). Differential Revision: http://reviews.llvm.org/D19172 llvm-svn: 267231
- Loading branch information
1 parent
1e9e615
commit aa641a5
Showing
96 changed files
with
657 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
//===----------- llvm/IR/OptBisect.h - LLVM Bisect support -------------===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
/// | ||
/// \file | ||
/// This file declares the interface for bisecting optimizations. | ||
/// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_IR_OPTBISECT_H | ||
#define LLVM_IR_OPTBISECT_H | ||
|
||
namespace llvm { | ||
|
||
class Pass; | ||
class StringRef; | ||
class Twine; | ||
|
||
/// 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. | ||
class OptBisect { | ||
public: | ||
/// \brief 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. | ||
OptBisect(); | ||
|
||
/// 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(). | ||
template <class UnitT> | ||
bool shouldRunPass(const Pass *P, const UnitT &U); | ||
|
||
/// Checks the bisect limit to determine if the optimization described by the | ||
/// /p Desc argument 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 with the | ||
/// bisect number assigned to the optimization along with the /p Desc | ||
/// description and return true. Otherwise, the function will print a message | ||
/// with the bisect number assigned to the optimization 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. | ||
/// | ||
/// Passes may call this function to provide more fine grained control over | ||
/// individual optimizations performed by the pass. Passes which cannot be | ||
/// skipped entirely (such as non-optional code generation passes) may still | ||
/// call this function to control whether or not individual optional | ||
/// transformations are performed. | ||
bool shouldRunCase(const Twine &Desc); | ||
|
||
private: | ||
bool checkPass(const StringRef PassName, const StringRef TargetDesc); | ||
|
||
bool BisectEnabled = false; | ||
unsigned LastBisectNum = 0; | ||
}; | ||
|
||
} // end namespace llvm | ||
|
||
#endif // LLVM_IR_OPTBISECT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.