Enable prevectorization with -enable-polly-vector.
This removes the separate prevector options for the Pluto and isl scheduler. llvm-svn: 142774
This commit is contained in:
parent
d5e80c5f9c
commit
67707b7131
|
@ -0,0 +1,20 @@
|
|||
//===------ polly/CodeGeneration.h - The Polly code generator *- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef POLLY_CODEGENERATION_H
|
||||
#define POLLY_CODEGENERATION_H
|
||||
|
||||
namespace polly {
|
||||
extern bool EnablePollyVector;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -26,6 +26,7 @@
|
|||
#include "polly/Support/GICHelper.h"
|
||||
#include "polly/Support/ScopHelper.h"
|
||||
#include "polly/Cloog.h"
|
||||
#include "polly/CodeGeneration.h"
|
||||
#include "polly/Dependences.h"
|
||||
#include "polly/ScopInfo.h"
|
||||
#include "polly/TempScopInfo.h"
|
||||
|
@ -53,11 +54,12 @@ struct isl_set;
|
|||
|
||||
namespace polly {
|
||||
|
||||
static cl::opt<bool>
|
||||
bool EnablePollyVector;
|
||||
|
||||
static cl::opt<bool, true>
|
||||
Vector("enable-polly-vector",
|
||||
cl::desc("Enable polly vector code generation"), cl::Hidden,
|
||||
cl::value_desc("Vector code generation enabled if true"),
|
||||
cl::init(false));
|
||||
cl::location(EnablePollyVector), cl::init(false));
|
||||
|
||||
static cl::opt<bool>
|
||||
OpenMP("enable-polly-openmp",
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#ifdef SCOPLIB_FOUND
|
||||
#include "polly/ScopInfo.h"
|
||||
#include "polly/Dependences.h"
|
||||
#include "polly/CodeGeneration.h"
|
||||
|
||||
#include "llvm/Support/Path.h"
|
||||
#include "llvm/Support/Program.h"
|
||||
|
@ -45,11 +46,6 @@ PlutoTile("enable-pluto-tile",
|
|||
cl::desc("Enable pluto tiling for polly"), cl::Hidden,
|
||||
cl::value_desc("Pluto tiling enabled if true"),
|
||||
cl::init(false));
|
||||
static cl::opt<bool>
|
||||
PlutoPrevector("enable-pluto-prevector",
|
||||
cl::desc("Enable pluto prevectorization for polly"), cl::Hidden,
|
||||
cl::value_desc("Pluto prevectorization enabled if true"),
|
||||
cl::init(false));
|
||||
static cl::opt<std::string>
|
||||
PlutoFuse("pluto-fuse",
|
||||
cl::desc(""), cl::Hidden,
|
||||
|
@ -127,7 +123,7 @@ bool Pocc::runOnScop(Scop &S) {
|
|||
if (PlutoTile)
|
||||
arguments.push_back("--pluto-tile");
|
||||
|
||||
if (PlutoPrevector)
|
||||
if (EnablePollyVector)
|
||||
arguments.push_back("--pluto-prevector");
|
||||
|
||||
arguments.push_back(0);
|
||||
|
@ -164,7 +160,7 @@ bool Pocc::runOnScop(Scop &S) {
|
|||
} else
|
||||
fclose(poccFile);
|
||||
|
||||
if (!PlutoPrevector)
|
||||
if (!EnablePollyVector)
|
||||
return false;
|
||||
|
||||
// Find the innermost dimension that is not a constant dimension. This
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "polly/Cloog.h"
|
||||
#include "polly/LinkAllPasses.h"
|
||||
|
||||
#include "polly/CodeGeneration.h"
|
||||
#include "polly/Support/GICHelper.h"
|
||||
#include "polly/Dependences.h"
|
||||
#include "polly/ScopInfo.h"
|
||||
|
@ -42,12 +43,6 @@ DisableTiling("polly-no-tiling",
|
|||
cl::desc("Disable tiling in the isl scheduler"), cl::Hidden,
|
||||
cl::init(false));
|
||||
|
||||
static cl::opt<bool>
|
||||
Prevector("polly-prevector",
|
||||
cl::desc("Enable prevectorization in the isl scheduler"), cl::Hidden,
|
||||
cl::value_desc("Prevectorization enabled"),
|
||||
cl::init(false));
|
||||
|
||||
namespace {
|
||||
|
||||
class IslScheduleOptimizer : public ScopPass {
|
||||
|
@ -310,7 +305,7 @@ static isl_union_map *tileBandList(isl_band_list *blist) {
|
|||
partialSchedule = isl_union_map_flat_range_product(partialSchedule,
|
||||
suffixSchedule);
|
||||
isl_band_list_free(children);
|
||||
} else if (Prevector) {
|
||||
} else if (EnablePollyVector) {
|
||||
isl_map *tileMap;
|
||||
isl_union_map *tileUnionMap;
|
||||
isl_ctx *ctx;
|
||||
|
|
|
@ -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 -polly-prevector %s -S | FileCheck %s -check-prefix=VECTOR
|
||||
; RUN: opt %loadPolly -polly-optimize-isl -polly-cloog -analyze -enable-polly-vector %s -S | FileCheck %s -check-prefix=VECTOR
|
||||
|
||||
|
||||
target datalayout =
|
||||
|
|
|
@ -35,6 +35,13 @@ also need to add '-mllvm -enable-polly-openmp -lgomp' to your CFLAGS.
|
|||
|
||||
<pre class="code">clang -load ${POLLY_BUILD_DIR}/lib/LLVMPolly.so -O3 -mllvm -enable-polly-openmp -lgomp file.c</pre>
|
||||
|
||||
<h2>Automatic Vector code generation</h2>
|
||||
|
||||
Automatic vector code generation can be enabled by adding '-mllvm
|
||||
-enable-polly-vector' to your CFLAGS.
|
||||
|
||||
<pre class="code">clang -load ${POLLY_BUILD_DIR}/lib/LLVMPolly.so -O3 -mllvm -enable-polly-vector file.c</pre>
|
||||
|
||||
<h2>Further options</h2>
|
||||
|
||||
Polly supports further options that are mainly useful for the development or
|
||||
|
|
Loading…
Reference in New Issue