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 e38fed44b1d..fcfc9ff6c8f 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -141,7 +141,7 @@ private:
///
/// - One i8 pointer for each external array reference used in the kernel.
/// - Host iterators
- /// - Parameters (TODO)
+ /// - Parameters
/// - Other LLVM Value references (TODO)
///
/// @param Kernel The kernel to generate the function declaration for.
@@ -228,6 +228,11 @@ Function *GPUNodeBuilder::createKernelFunctionDecl(ppcg_kernel *Kernel) {
for (long i = 0; i < NumHostIters; i++)
Args.push_back(Builder.getInt64Ty());
+ int NumVars = isl_space_dim(Kernel->space, isl_dim_param);
+
+ for (long i = 0; i < NumVars; i++)
+ Args.push_back(Builder.getInt64Ty());
+
auto *FT = FunctionType::get(Builder.getVoidTy(), Args, false);
auto *FN = Function::Create(FT, Function::ExternalLinkage, Identifier,
GPUModule.get());
@@ -250,6 +255,14 @@ Function *GPUNodeBuilder::createKernelFunctionDecl(ppcg_kernel *Kernel) {
Arg++;
}
+ for (long i = 0; i < NumVars; i++) {
+ isl_id *Id = isl_space_get_dim_id(Kernel->space, isl_dim_param, 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