forked from OSchip/llvm-project
Register Passes: Use -polly-optimizer=(isl|pocc) to switch optimizers
This replaces the old option -polly-use-pocc. Also call the passes uniformly -polly-opt-pocc and -polly-opt-isl. llvm-svn: 145071
This commit is contained in:
parent
3885737a1b
commit
4dca439cfc
|
@ -268,7 +268,8 @@ bool ScopDetection::isValidMemoryAccess(Instruction &Inst,
|
|||
// disable this check to not cause irrelevant verification failures.
|
||||
if (!AS.isMustAlias() && !IgnoreAliasing)
|
||||
INVALID_NOVERIFY(Alias,
|
||||
"Possible aliasing found for value: " << *BaseValue);
|
||||
"Possible aliasing for value: " << BaseValue->getName()
|
||||
<< "\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -274,11 +274,11 @@ void Pocc::getAnalysisUsage(AnalysisUsage &AU) const {
|
|||
AU.addRequired<Dependences>();
|
||||
}
|
||||
|
||||
INITIALIZE_PASS_BEGIN(Pocc, "polly-optimize",
|
||||
INITIALIZE_PASS_BEGIN(Pocc, "polly-opt-pocc",
|
||||
"Polly - Optimize the scop using pocc", false, false)
|
||||
INITIALIZE_PASS_DEPENDENCY(Dependences)
|
||||
INITIALIZE_PASS_DEPENDENCY(ScopInfo)
|
||||
INITIALIZE_PASS_END(Pocc, "polly-optimize",
|
||||
INITIALIZE_PASS_END(Pocc, "polly-opt-pocc",
|
||||
"Polly - Optimize the scop using pocc", false, false)
|
||||
|
||||
Pass* polly::createPoccPass() {
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "polly/ScopInfo.h"
|
||||
#include "polly/TempScopInfo.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
static cl::opt<bool>
|
||||
|
@ -40,10 +42,11 @@ static cl::opt<bool>
|
|||
DisableCodegen("polly-no-codegen",
|
||||
cl::desc("Disable Polly Code Generation"), cl::Hidden,
|
||||
cl::init(false));
|
||||
static cl::opt<bool>
|
||||
UsePocc("polly-use-pocc",
|
||||
cl::desc("Use the PoCC optimizer instead of the one in isl"), cl::Hidden,
|
||||
cl::init(false));
|
||||
static cl::opt<std::string>
|
||||
Optimizer("polly-optimizer",
|
||||
cl::desc("Select the scheduling optimizer. "
|
||||
"Either isl (default) or pocc."),
|
||||
cl::Hidden, cl::init("isl"));
|
||||
static cl::opt<bool>
|
||||
ImportJScop("polly-run-import-jscop",
|
||||
cl::desc("Export the JScop description of the detected Scops"),
|
||||
|
@ -113,10 +116,6 @@ static void registerPollyPasses(const llvm::PassManagerBuilder &Builder,
|
|||
PollyEnabled = true;
|
||||
|
||||
if (!PollyEnabled) {
|
||||
if (UsePocc)
|
||||
errs() << "The option -polly-use-pocc has no effect. "
|
||||
"Polly was not enabled\n";
|
||||
|
||||
if (DisableCodegen)
|
||||
errs() << "The option -polly-no-codegen has no effect. "
|
||||
"Polly was not enabled\n";
|
||||
|
@ -183,16 +182,20 @@ static void registerPollyPasses(const llvm::PassManagerBuilder &Builder,
|
|||
PM.add(polly::createJSONImporterPass());
|
||||
|
||||
if (RunScheduler) {
|
||||
if (UsePocc) {
|
||||
if (Optimizer == "pocc") {
|
||||
#ifdef SCOPLIB_FOUND
|
||||
PM.add(polly::createPoccPass());
|
||||
#else
|
||||
errs() << "Polly is compiled without scoplib support. As scoplib is "
|
||||
<< "required to run PoCC, PoCC is also not available. Falling "
|
||||
<< "back to the isl optimizer.\n";
|
||||
"required to run PoCC, PoCC is also not available. Falling "
|
||||
"back to the isl optimizer.\n";
|
||||
PM.add(polly::createIslScheduleOptimizerPass());
|
||||
#endif
|
||||
} else if (Optimizer == "isl") {
|
||||
PM.add(polly::createIslScheduleOptimizerPass());
|
||||
} else {
|
||||
errs() << "Invalid optimizer. Only 'isl' and 'pocc' allowed. "
|
||||
"Falling back to 'isl'.\n";
|
||||
PM.add(polly::createIslScheduleOptimizerPass());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "isl/schedule.h"
|
||||
#include "isl/band.h"
|
||||
|
||||
#define DEBUG_TYPE "polly-optimize-isl"
|
||||
#define DEBUG_TYPE "polly-opt-isl"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
|
||||
|
@ -432,11 +432,11 @@ void IslScheduleOptimizer::getAnalysisUsage(AnalysisUsage &AU) const {
|
|||
AU.addRequired<Dependences>();
|
||||
}
|
||||
|
||||
INITIALIZE_PASS_BEGIN(IslScheduleOptimizer, "polly-optimize-isl",
|
||||
INITIALIZE_PASS_BEGIN(IslScheduleOptimizer, "polly-opt-isl",
|
||||
"Polly - Optimize schedule of SCoP", false, false)
|
||||
INITIALIZE_PASS_DEPENDENCY(Dependences)
|
||||
INITIALIZE_PASS_DEPENDENCY(ScopInfo)
|
||||
INITIALIZE_PASS_END(IslScheduleOptimizer, "polly-optimize-isl",
|
||||
INITIALIZE_PASS_END(IslScheduleOptimizer, "polly-opt-isl",
|
||||
"Polly - Optimize schedule of SCoP", false, false)
|
||||
|
||||
Pass* polly::createIslScheduleOptimizerPass() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; RUN: opt %loadPolly -polly-optimize-isl -polly-cloog -analyze %s -S | FileCheck %s
|
||||
; RUN: opt %loadPolly -polly-optimize-isl -polly-cloog -analyze -enable-polly-vector %s -S | FileCheck %s -check-prefix=VECTOR
|
||||
; RUN: opt %loadPolly -polly-opt-isl -polly-cloog -analyze %s -S | FileCheck %s
|
||||
; RUN: opt %loadPolly -polly-opt-isl -polly-cloog -analyze -enable-polly-vector %s -S | FileCheck %s -check-prefix=VECTOR
|
||||
|
||||
|
||||
target datalayout =
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
<h2>Middle End</h2>
|
||||
<ul>
|
||||
<li><em>polly-dependences</em> Calculate the dependences in a SCoPs</li>
|
||||
<li><em>polly-interchange</em> Perform loop interchange (work in progress)</li>
|
||||
<li><em>polly-optimize</em> Optimize the SCoP using PoCC</li>
|
||||
<li><em>polly-opt-pocc</em> Optimize the SCoP using PoCC</li>
|
||||
<li><em>polly-opt-isl</em> Optimize the SCoP using isl</li>
|
||||
<li>Import/Export
|
||||
<ul>
|
||||
<li><em>polly-export-cloog</em> Export the CLooG input file
|
||||
|
|
Loading…
Reference in New Issue