diff options
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index f8cf3b78515..955aaac08b4 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -929,6 +929,24 @@ Value *GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Index++; } + int NumVars = isl_space_dim(Kernel->space, isl_dim_param); + + for (long i = 0; i < NumVars; i++) { + isl_id *Id = isl_space_get_dim_id(Kernel->space, isl_dim_param, i); + Value *Val = IDToValue[Id]; + isl_id_free(Id); + Instruction *Param = new AllocaInst( + Val->getType(), Launch + "_param_" + std::to_string(Index), + EntryBlock->getTerminator()); + Builder.CreateStore(Val, Param); + Value *Slot = Builder.CreateGEP( + Parameters, {Builder.getInt64(0), Builder.getInt64(Index)}); + Value *ParamTyped = + Builder.CreatePointerCast(Param, Builder.getInt8PtrTy()); + Builder.CreateStore(ParamTyped, Slot); + Index++; + } + auto Location = EntryBlock->getTerminator(); return new BitCastInst(Parameters, Builder.getInt8PtrTy(), Launch + "_params_i8ptr", Location); |

