Add check to early exit when OpenCL builtin is not found in the map#2525
Add check to early exit when OpenCL builtin is not found in the map#2525asudarsa wants to merge 1 commit intoKhronosGroup:mainfrom
Conversation
Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
|
The fix of the issue is likely a little bigger than "atomic". The changes covers "atomic" prefix but there are other prefixes in |
Hi @bwlodarcz Thanks much for the feedback. Sincerely |
The transBuiltin(...) function already has the check to see if the function we are looking at has a valid OCL builtin (See ).This check was missing in transAtomicBuiltin(...) and this PR adds that check. I do not see any other site where this check is required. So, I think this PR can be submitted as is. Thanks for all the feedback. |
|
@asudarsa Unfortunately the change doesn't work/is not enough. Let's replace Standard llvm-as followed by llvm-spirv sequence to reproduce. |
bwlodarcz
left a comment
There was a problem hiding this comment.
Described in previous comment.
Several user defined/declared functions were being identified as 'possible' OpenCL builtins as they had prefixes (e.g. atomic_) similar to OpenCL builtin function names. However, they were not present in the OCLSPIRVBuiltinMap.
One of the OCLToSPIRV utility functions calls OCLSPIRVBuiltinMap::map function on such user defined functions and this results in a crash.
The correct way to do this will be to check if the OCL function name key is present in the map and exit early if not.
This PR does that.
Thanks