1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

[IRCE] Add a -irce-print-range-checks option.

-irce-print-range-checks prints out the set of range checks recognized
by IRCE.

llvm-svn: 232451
This commit is contained in:
Sanjoy Das 2015-03-17 01:40:22 +00:00
parent 5637a3e3c5
commit 56a1924548

View File

@ -82,6 +82,9 @@ static cl::opt<unsigned> LoopSizeCutoff("irce-loop-size-cutoff", cl::Hidden,
static cl::opt<bool> PrintChangedLoops("irce-print-changed-loops", cl::Hidden,
cl::init(false));
static cl::opt<bool> PrintRangeChecks("irce-print-range-checks", cl::Hidden,
cl::init(false));
static cl::opt<int> MaxExitProbReciprocal("irce-max-exit-prob-reciprocal",
cl::Hidden, cl::init(10));
@ -1392,12 +1395,18 @@ bool InductiveRangeCheckElimination::runOnLoop(Loop *L, LPPassManager &LPM) {
if (RangeChecks.empty())
return false;
DEBUG(dbgs() << "irce: looking at loop "; L->print(dbgs());
dbgs() << "irce: loop has " << RangeChecks.size()
<< " inductive range checks: \n";
for (InductiveRangeCheck *IRC : RangeChecks)
IRC->print(dbgs());
);
auto PrintRecognizedRangeChecks = [&](raw_ostream &OS) {
OS << "irce: looking at loop "; L->print(OS);
OS << "irce: loop has " << RangeChecks.size()
<< " inductive range checks: \n";
for (InductiveRangeCheck *IRC : RangeChecks)
IRC->print(OS);
};
DEBUG(PrintRecognizedRangeChecks(dbgs()));
if (PrintRangeChecks)
PrintRecognizedRangeChecks(errs());
const char *FailureReason = nullptr;
Optional<LoopStructure> MaybeLoopStructure =