KhronosGroup / KhronosGroup/SPIRV-LLVM-Translator

User defined/declared functions are wrongly identified as OpenCL builtins

Open
#2,513 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
LLVM
Stars
625
Forks
279
Avg merge
3d 5h
Merged PRs (30d)
34

Description

Existing checks in OCLIsBuiltin(...) function are not sufficient to identify OpenCL builtins correctly. There is a possibility that user can define/declare functions with names that could cause them to be identified as OpenCL builtins.

An LLVM IR test that showcases this issue has been added as part of an ongoing PR:
https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/2512/files#diff-7bb994ec5258f2246431ab51bfff2ff1643b801fefdd7a498c666ba5c1480ac4

Without the fix in this PR (https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/2512), this test will fail.

The above PR addresses user-defined functions. However, we do not currently have a resolution for user-declared functions.

Thanks

Contributor guide

Open the contributing guide

Research direction

Start with the OCLIsBuiltin(...) checks and the LLVM IR test linked from PR 2512, which demonstrates the user-defined-function problem. Compare the existing PR changes with the remaining case for user-declared functions. Done means the builtin identification no longer misclassifies either kind of function and the relevant IR test passes.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.