diff options
| author | Tobias Grosser <tobias@grosser.es> | 2016-07-28 06:47:50 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2016-07-28 06:47:50 +0000 |
| commit | 4e18d71c71788654dd5c3e3b151ada8666b91029 (patch) | |
| tree | 8a7612983a32e943b1bae63f9c6dfe2753b3bc09 /polly | |
| parent | 19d024b2fd930acad84fe6c33c2af93725408875 (diff) | |
| download | bcm5719-llvm-4e18d71c71788654dd5c3e3b151ada8666b91029.tar.gz bcm5719-llvm-4e18d71c71788654dd5c3e3b151ada8666b91029.zip | |
GPGPU: Generate kernel parameter allocation with right size
Before this change we miscounted the number of function parameters.
llvm-svn: 276960
Diffstat (limited to 'polly')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 3 | ||||
| -rw-r--r-- | polly/test/GPGPU/double-parallel-loop.ll | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index d0ae82aec3c..20ab4999cf7 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 5306620811c..f0839ba9c98 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 |

