summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index d1bdf5506d7..e38fed44b1d 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -140,7 +140,7 @@ private:
/// The kernel function takes as arguments:
///
/// - One i8 pointer for each external array reference used in the kernel.
- /// - Host iterators (TODO)
+ /// - Host iterators
/// - Parameters (TODO)
/// - Other LLVM Value references (TODO)
///
@@ -223,6 +223,11 @@ Function *GPUNodeBuilder::createKernelFunctionDecl(ppcg_kernel *Kernel) {
Args.push_back(Builder.getInt8PtrTy());
}
+ int NumHostIters = isl_space_dim(Kernel->space, isl_dim_set);
+
+ for (long i = 0; i < NumHostIters; i++)
+ Args.push_back(Builder.getInt64Ty());
+
auto *FT = FunctionType::get(Builder.getVoidTy(), Args, false);
auto *FN = Function::Create(FT, Function::ExternalLinkage, Identifier,
GPUModule.get());
@@ -237,6 +242,14 @@ Function *GPUNodeBuilder::createKernelFunctionDecl(ppcg_kernel *Kernel) {
Arg++;
}
+ for (long i = 0; i < NumHostIters; i++) {
+ isl_id *Id = isl_space_get_dim_id(Kernel->space, isl_dim_set, i);
+ Arg->setName(isl_id_get_name(Id));
+ IDToValue[Id] = &*Arg;
+ KernelIDs.insert(std::unique_ptr<isl_id, IslIdDeleter>(Id));
+ Arg++;
+ }
+
return FN;
}
OpenPOWER on IntegriCloud