[llvm] r297542 - Remove opt-bisect support for "cases" in favor of debug counters
Daniel Berlin via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 10 17:41:03 PST 2017
Author: dannyb
Date: Fri Mar 10 19:41:03 2017
New Revision: 297542
URL: http://llvm.org/viewvc/llvm-project?rev=297542&view=rev
Log:
Remove opt-bisect support for "cases" in favor of debug counters
Summary:
Ths "cases" support was not quite finished, is unused, and is really just debug counters.
(well, almost, debug counters are slightly more powerful, in that they can skip things at the start, too).
Note, opt-bisect itself could also be implemented as a wrapper around
debug counters, but not sure it's worth it ATM.
I'll shove it on a todo list if we think it is.
Reviewers: MatzeB, chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D30856
Modified:
llvm/trunk/docs/OptBisect.rst
llvm/trunk/include/llvm/IR/OptBisect.h
llvm/trunk/lib/IR/OptBisect.cpp
Modified: llvm/trunk/docs/OptBisect.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/OptBisect.rst?rev=297542&r1=297541&r2=297542&view=diff
==============================================================================
--- llvm/trunk/docs/OptBisect.rst (original)
+++ llvm/trunk/docs/OptBisect.rst Fri Mar 10 19:41:03 2017
@@ -189,12 +189,5 @@ Adding Finer Granularity
Once the pass in which an incorrect transformation is performed has been
determined, it may be useful to perform further analysis in order to determine
-which specific transformation is causing the problem. Ideally all passes
-would be instrumented to allow skipping of individual transformations. This
-functionality is available through the OptBisect object but it is impractical
-to proactively instrument every existing pass. It is hoped that as developers
-find that they need a pass to be instrumented they will add the instrumentation
-and contribute it back to the LLVM source base.
-
-Helper functions will be added to simplify this level of instrumentation, but
-this work is not yet completed. For more information, contact Andy Kaylor.
+which specific transformation is causing the problem. Debug counters
+can be used for this purpose.
Modified: llvm/trunk/include/llvm/IR/OptBisect.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/OptBisect.h?rev=297542&r1=297541&r2=297542&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/OptBisect.h (original)
+++ llvm/trunk/include/llvm/IR/OptBisect.h Fri Mar 10 19:41:03 2017
@@ -51,24 +51,6 @@ public:
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);
Modified: llvm/trunk/lib/IR/OptBisect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/OptBisect.cpp?rev=297542&r1=297541&r2=297542&view=diff
==============================================================================
--- llvm/trunk/lib/IR/OptBisect.cpp (original)
+++ llvm/trunk/lib/IR/OptBisect.cpp Fri Mar 10 19:41:03 2017
@@ -39,14 +39,6 @@ static void printPassMessage(const Strin
<< "(" << PassNum << ") " << Name << " on " << TargetDesc << "\n";
}
-static void printCaseMessage(int CaseNum, StringRef Msg, bool Running) {
- if (Running)
- errs() << "BISECT: running case (";
- else
- errs() << "BISECT: NOT running case (";
- errs() << CaseNum << "): " << Msg << "\n";
-}
-
static std::string getDescription(const Module &M) {
return "module (" + M.getName().str() + ")";
}
@@ -108,13 +100,3 @@ bool OptBisect::checkPass(const StringRe
printPassMessage(PassName, CurBisectNum, TargetDesc, ShouldRun);
return ShouldRun;
}
-
-bool OptBisect::shouldRunCase(const Twine &Msg) {
- if (!BisectEnabled)
- return true;
- int CurFuelNum = ++LastBisectNum;
- bool ShouldRun = (OptBisectLimit == -1 || CurFuelNum <= OptBisectLimit);
- printCaseMessage(CurFuelNum, Msg.str(), ShouldRun);
- return ShouldRun;
-}
-
More information about the llvm-commits
mailing list