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

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 19 09:01:29 PDT 2017


bader added inline comments.


================
Comment at: test/CodeGenOpenCL/sampler.cl:62
+
+  const sampler_t const_smp = CLK_ADDRESS_CLAMP_TO_EDGE | CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR;
+  // CHECK: [[CONST_SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35)
----------------
yaxunl wrote:
> what if address of const_smp is taken and assigned to a pointer to sampler_t ? Do we have diagnosis in place?
AFAIK, we have diagnostics for both:
- declaration of a pointer to sampler
- taking address of sampler variable


https://reviews.llvm.org/D34342





More information about the cfe-commits mailing list