OpenCL and SPIR version metadata must be generated once per module instead of once per mangled global value.
Details
Diff Detail
- Build Status
Buildable 7293 Build 7293: arc lint + arc unit
Event Timeline
lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
516 | CodeGenTypeCache (CodeGenModule's base class) has member Int32Ty, so I don't think you need to call getInt32Ty here? |
test/CodeGenOpenCL/spir_version.cl | ||
---|---|---|
13 | 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? |
test/CodeGenOpenCL/spir_version.cl | ||
---|---|---|
13 | 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. |
CodeGenTypeCache (CodeGenModule's base class) has member Int32Ty, so I don't think you need to call getInt32Ty here?