OpenCL runtime tracks the invoke function emitted for
any block expression. Due to restrictions on blocks in
OpenCL (v2.0 s6.12.5), it is always possible to know the
block invoke function when emitting call of block expression
or __enqueue_kernel builtin functions. Since __enqueu_kernel
already has an argument for the invoke function, it is redundant
to have invoke function member in the llvm block literal structure.
This patch removes invoke function from the llvm block literal
structure. It also removes the bitcast of block invoke function
to the "generic block literal type" which is useless for OpenCL.
This will save some space for the kernel argument, and also
eliminate some store instructions.
I think it would be more readable if we merge this if statement with the if statement at the line #1103.
It's used to initialize FuncPtr for non-OpenCL languages and the first use of this variable is in the else block of if statement at the line #1103.
If I didn't miss something it should reasonable to combine this if block with 'else' block at the line #1106.