summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2011-10-23 20:59:40 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2011-10-23 20:59:40 +0000
commit67707b7131208f8c06bea56217d9fdf7b5a38698 (patch)
tree387bf4687764cd971ed70c153f95f90f23a6c55b
parentd5e80c5f9ce2f631107bdc3af6e3f7e10d88d232 (diff)
downloadbcm5719-llvm-67707b7131208f8c06bea56217d9fdf7b5a38698.tar.gz
bcm5719-llvm-67707b7131208f8c06bea56217d9fdf7b5a38698.zip
Enable prevectorization with -enable-polly-vector.
This removes the separate prevector options for the Pluto and isl scheduler. llvm-svn: 142774
-rw-r--r--polly/include/polly/CodeGeneration.h20
-rw-r--r--polly/lib/CodeGeneration.cpp8
-rw-r--r--polly/lib/Pocc.cpp10
-rw-r--r--polly/lib/ScheduleOptimizer.cpp9
-rw-r--r--polly/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll2
-rw-r--r--polly/www/example_load_Polly_into_clang.html7
6 files changed, 38 insertions, 18 deletions
diff --git a/polly/include/polly/CodeGeneration.h b/polly/include/polly/CodeGeneration.h
new file mode 100644
index 00000000000..56691437939
--- /dev/null
+++ b/polly/include/polly/CodeGeneration.h
@@ -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
+
diff --git a/polly/lib/CodeGeneration.cpp b/polly/lib/CodeGeneration.cpp
index 8faaa65afc9..51fe7173d32 100644
--- a/polly/lib/CodeGeneration.cpp
+++ b/polly/lib/CodeGeneration.cpp
@@ -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",
diff --git a/polly/lib/Pocc.cpp b/polly/lib/Pocc.cpp
index 0dab3fd397a..793d090e5ba 100644
--- a/polly/lib/Pocc.cpp
+++ b/polly/lib/Pocc.cpp
@@ -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
diff --git a/polly/lib/ScheduleOptimizer.cpp b/polly/lib/ScheduleOptimizer.cpp
index 2583057348f..02527220258 100644
--- a/polly/lib/ScheduleOptimizer.cpp
+++ b/polly/lib/ScheduleOptimizer.cpp
@@ -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;
diff --git a/polly/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll b/polly/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll
index d144fa16511..05beba12c22 100644
--- a/polly/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll
+++ b/polly/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll
@@ -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 =
diff --git a/polly/www/example_load_Polly_into_clang.html b/polly/www/example_load_Polly_into_clang.html
index dbcc313e867..38984c3d567 100644
--- a/polly/www/example_load_Polly_into_clang.html
+++ b/polly/www/example_load_Polly_into_clang.html
@@ -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
OpenPOWER on IntegriCloud