module = F.getParent();
intTy = IntegerType::get(module->getContext(), 32);
- builder = new IRBuilder<>(module->getContext());
// As we inline all function calls, so skip non-kernel functions
bool bKernel = isKernelFunction(F);
if(!bKernel) return false;
+ builder = new IRBuilder<>(module->getContext());
+
/* Iter the function and find printf. */
for (llvm::Function::iterator B = F.begin(), BE = F.end(); B != BE; B++) {
for (BasicBlock::iterator instI = B->begin(),
cl_gpgpu_unmap_printf_buffer(gpgpu, 0);
if (interp_get_printf_sizeof_size(printf_info))
cl_gpgpu_unmap_printf_buffer(gpgpu, 1);
+ }
+ if (printf_info) {
interp_release_printf_info(printf_info);
global_wk_sz[0] = global_wk_sz[1] = global_wk_sz[2] = 0;
cl_gpgpu_set_printf_info(gpgpu, NULL, global_wk_sz);