[llvm-commits] [polly] r157242 - in /polly/trunk: include/polly/Dependences.h lib/Analysis/Dependences.cpp lib/CodeGen/CodeGeneration.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Tue May 22 01:46:08 PDT 2012
Author: grosser
Date: Tue May 22 03:46:07 2012
New Revision: 157242
URL: http://llvm.org/viewvc/llvm-project?rev=157242&view=rev
Log:
Move isParallelFor into CodeGeneration
This removes another include of CLooG header files.
Modified:
polly/trunk/include/polly/Dependences.h
polly/trunk/lib/Analysis/Dependences.cpp
polly/trunk/lib/CodeGen/CodeGeneration.cpp
Modified: polly/trunk/include/polly/Dependences.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/Dependences.h?rev=157242&r1=157241&r2=157242&view=diff
==============================================================================
--- polly/trunk/include/polly/Dependences.h (original)
+++ polly/trunk/include/polly/Dependences.h Tue May 22 03:46:07 2012
@@ -84,16 +84,6 @@
bool isParallelDimension(__isl_take isl_set *LoopDomain,
unsigned ParallelDimension);
- /// @brief Check if a loop is parallel
- ///
- /// Detect if a clast_for loop can be executed in parallel.
- ///
- /// @param f The clast for loop to check.
- ///
- /// @return bool Returns true if the incoming clast_for statement can
- /// execute in parallel.
- bool isParallelFor(const clast_for *For);
-
/// @brief Get the dependences in this Scop.
///
/// @param Kinds This integer defines the different kinds of dependences
Modified: polly/trunk/lib/Analysis/Dependences.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/Dependences.cpp?rev=157242&r1=157241&r2=157242&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/Dependences.cpp (original)
+++ polly/trunk/lib/Analysis/Dependences.cpp Tue May 22 03:46:07 2012
@@ -30,11 +30,10 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/CommandLine.h"
-#include <isl/flow.h>
#include <isl/aff.h>
-#define CLOOG_INT_GMP 1
-#include <cloog/cloog.h>
-#include <cloog/isl/cloog.h>
+#include <isl/flow.h>
+#include <isl/map.h>
+#include <isl/set.h>
using namespace polly;
using namespace llvm;
@@ -218,13 +217,6 @@
return IsParallel;
}
-bool Dependences::isParallelFor(const clast_for *f) {
- isl_set *Domain = isl_set_from_cloog_domain(f->domain);
- assert(Domain && "Cannot access domain of loop");
-
- return isParallelDimension(isl_set_copy(Domain), isl_set_n_dim(Domain));
-}
-
void Dependences::printScop(raw_ostream &OS) const {
}
Modified: polly/trunk/lib/CodeGen/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CodeGeneration.cpp?rev=157242&r1=157241&r2=157242&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/CodeGeneration.cpp Tue May 22 03:46:07 2012
@@ -283,6 +283,16 @@
/// statement.
void codegenForOpenMP(const clast_for *f);
+ /// @brief Check if a loop is parallel
+ ///
+ /// Detect if a clast_for loop can be executed in parallel.
+ ///
+ /// @param f The clast for loop to check.
+ ///
+ /// @return bool Returns true if the incoming clast_for statement can
+ /// execute in parallel.
+ bool isParallelFor(const clast_for *For);
+
bool isInnermostLoop(const clast_for *f);
/// @brief Get the number of loop iterations for this loop.
@@ -608,9 +618,19 @@
ClastVars.erase(F->iterator);
}
+
+bool ClastStmtCodeGen::isParallelFor(const clast_for *f) {
+ isl_set *Domain = isl_set_from_cloog_domain(f->domain);
+ assert(Domain && "Cannot access domain of loop");
+
+ Dependences &D = P->getAnalysis<Dependences>();
+
+ return D.isParallelDimension(isl_set_copy(Domain), isl_set_n_dim(Domain));
+}
+
void ClastStmtCodeGen::codegen(const clast_for *f) {
bool Vector = PollyVectorizerChoice != VECTORIZER_NONE;
- if ((Vector || OpenMP) && P->getAnalysis<Dependences>().isParallelFor(f)) {
+ if ((Vector || OpenMP) && isParallelFor(f)) {
if (Vector && isInnermostLoop(f) && (-1 != getNumberOfIterations(f))
&& (getNumberOfIterations(f) <= 16)) {
codegenForVector(f);
More information about the llvm-commits
mailing list