[PATCH] D34342: [OpenCL] Fix code generation of function-scope constant samplers.

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 11:39:09 PDT 2017


Anastasia added a comment.

In https://reviews.llvm.org/D34342#792350, @bader wrote:

> Note: `get_sampler_initializer` from my test case returns integer, not a sampler, but having function is not relevant to the problem. 
>  Here is a bit simplified test case without function calls that still reproduces the problem:
>
>   kernel void foo(int sampler_init_value) {
>     const sampler_t const_smp_func_init = sampler_init_value;
>   }
>
>
> The problem is in the function that handles sampler initialization with integer.
>  There should no problems with the case you provided as it doesn't require additional function call injection.


This seems like a valid code which should be compiled in my view. At least I don't see anything in the spec that disallows this. This is not an interesting use case though, however it becomes more interesting with the use of ternary operator. Do you see any issues fixing the CodeGen for it?


https://reviews.llvm.org/D34342





More information about the cfe-commits mailing list