diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index d0ae82aec3c0..20ab4999cf7d 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -880,7 +880,8 @@ GPUNodeBuilder::getBlockSizes(ppcg_kernel *Kernel) { Value *GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F) { - Type *ArrayTy = ArrayType::get(Builder.getInt8PtrTy(), F->getNumOperands()); + Type *ArrayTy = ArrayType::get(Builder.getInt8PtrTy(), + std::distance(F->arg_begin(), F->arg_end())); BasicBlock *EntryBlock = &Builder.GetInsertBlock()->getParent()->getEntryBlock(); diff --git a/polly/test/GPGPU/double-parallel-loop.ll b/polly/test/GPGPU/double-parallel-loop.ll index 5306620811c5..f0839ba9c98b 100644 --- a/polly/test/GPGPU/double-parallel-loop.ll +++ b/polly/test/GPGPU/double-parallel-loop.ll @@ -98,7 +98,7 @@ ; IR-NEXT: call void @polly_copyFromHostToDevice(i8* [[HostPtr]], i8* %p_dev_array_MemRef_A, i64 4194304) ; IR-NEXT: [[DevPtr:%.*]] = call i8* @polly_getDevicePtr(i8* %p_dev_array_MemRef_A) ; IR-NEXT: store i8* [[DevPtr]], i8** %polly_launch_0_param_0 -; IR-NEXT: [[ParamSlot:%.*]] = getelementptr [0 x i8*], [0 x i8*]* %polly_launch_0_params, i64 0, i64 0 +; IR-NEXT: [[ParamSlot:%.*]] = getelementptr [1 x i8*], [1 x i8*]* %polly_launch_0_params, i64 0, i64 0 ; IR-NEXT: [[ParamTyped:%.*]] = bitcast i8** %polly_launch_0_param_0 to i8* ; IR-NEXT: store i8* [[ParamTyped]], i8** [[ParamSlot]] ; IR-NEXT: call i8* @polly_getKernel