[PATCH] D34235: [OpenCL] Fix OpenCL and SPIR version metadata generation.
Alexey Bader via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 19 10:16:23 PDT 2017
bader added inline comments.
================
Comment at: test/CodeGenOpenCL/spir_version.cl:13
kernel void foo() {}
+kernel void bar() {}
----------------
Anastasia wrote:
> Would the original code produce duplicate version metadata here or is it just for overloaded functions? Would it make sense to add `CHECK-NOT` to make sure they are not generated twice?
The original code will duplicate the metadata here. Something like:
```
!opencl.ocl.version = !{!0, !0}
```
One per global value - function in case.
Existing check is already good enough as it checks exactly for one metadata:
```
// CHECK-SPIR-CL10-DAG: !opencl.ocl.version = !{[[OCL:![0-9]+]]}
```
It was passing with buggy code, since test contains exactly one function (i.e. global value). Now we have two global values and fix is required to pass existing check.
https://reviews.llvm.org/D34235
More information about the cfe-commits
mailing list