KhronosGroup / SPIRV-LLVM-Translator

A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Other
468 stars 209 forks source link

[OClToSPIRV] Do not identify user defined functions as OpenCL builtins #2512

Open asudarsa opened 4 months ago

asudarsa commented 4 months ago

There are scenarios where users define functions with names as 'atomic_fetch_and_sub_uint32'. Such functions are being wrongly identified as OpenCL builtins. This change adds the following to OCLIsBuiltin(...) function if (!F->isDeclaration()) return false;

This resolves several existing test failures.

Thanks

asudarsa commented 4 months ago

A better solution has been submitted here: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/2525 Once approved, I will close this one.

Thanks