From 4e18d71c71788654dd5c3e3b151ada8666b91029 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Thu, 28 Jul 2016 06:47:50 +0000 Subject: GPGPU: Generate kernel parameter allocation with right size Before this change we miscounted the number of function parameters. llvm-svn: 276960 --- polly/lib/CodeGen/PPCGCodeGeneration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp') 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(); -- cgit v1.2.3