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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Berlin 2017-03-11 01:41:03 +00:00
parent 621f2c2cdd
commit 57bd1ea8eb
3 changed files with 2 additions and 45 deletions

View File

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

View File

@ -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);

View File

@ -39,14 +39,6 @@ static void printPassMessage(const StringRef &Name, int PassNum,
<< "(" << 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 StringRef PassName,
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;
}