Disable LSR retry by default.

Disabling aggressive LSR saves compilation time, and with the new
indvars behavior usually improves performance.

llvm-svn: 140590
This commit is contained in:
Andrew Trick 2011-09-27 00:44:14 +00:00
parent d889d2461f
commit 581243919d
1 changed files with 16 additions and 0 deletions

View File

@ -70,12 +70,18 @@
#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SetVector.h"
#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DenseSet.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ValueHandle.h" #include "llvm/Support/ValueHandle.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetLowering.h"
#include <algorithm> #include <algorithm>
using namespace llvm; using namespace llvm;
namespace llvm {
cl::opt<bool> EnableRetry(
"enable-lsr-retry", cl::Hidden, cl::desc("Enable LSR retry"));
}
namespace { namespace {
/// RegSortData - This class holds data which is used to order reuse candidates. /// RegSortData - This class holds data which is used to order reuse candidates.
@ -3309,6 +3315,9 @@ retry:
skip:; skip:;
} }
if (!EnableRetry && !AnySatisfiedReqRegs)
return;
// If none of the formulae had all of the required registers, relax the // If none of the formulae had all of the required registers, relax the
// constraint so that we don't exclude all formulae. // constraint so that we don't exclude all formulae.
if (!AnySatisfiedReqRegs) { if (!AnySatisfiedReqRegs) {
@ -3332,6 +3341,10 @@ void LSRInstance::Solve(SmallVectorImpl<const Formula *> &Solution) const {
// SolveRecurse does all the work. // SolveRecurse does all the work.
SolveRecurse(Solution, SolutionCost, Workspace, CurCost, SolveRecurse(Solution, SolutionCost, Workspace, CurCost,
CurRegs, VisitedRegs); CurRegs, VisitedRegs);
if (Solution.empty()) {
DEBUG(dbgs() << "\nNo Satisfactory Solution\n");
return;
}
// Ok, we've now made all our decisions. // Ok, we've now made all our decisions.
DEBUG(dbgs() << "\n" DEBUG(dbgs() << "\n"
@ -3811,6 +3824,9 @@ LSRInstance::LSRInstance(const TargetLowering *tli, Loop *l, Pass *P)
Types.clear(); Types.clear();
RegUses.clear(); RegUses.clear();
if (Solution.empty())
return;
#ifndef NDEBUG #ifndef NDEBUG
// Formulae should be legal. // Formulae should be legal.
for (SmallVectorImpl<LSRUse>::const_iterator I = Uses.begin(), for (SmallVectorImpl<LSRUse>::const_iterator I = Uses.begin(),