This is an archive of the discontinued LLVM Phabricator instance.

Emit OpenCL metadata when targeting SPIR-V
ClosedPublic

Authored by shangwuyao on Apr 4 2022, 9:54 AM.

Details

Summary

This is required for converting function calls such as get_global_id()
into SPIR-V builtins.

Diff Detail

Event Timeline

shangwuyao created this revision.Apr 4 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2022, 9:54 AM
shangwuyao requested review of this revision.Apr 4 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2022, 9:54 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Is this because your HIP threadIdx etc are implemented using OpenCL builtins so that the emitted LLVM IR contains calls of OpenCL builtins?

Is this because your HIP threadIdx etc are implemented using OpenCL builtins so that the emitted LLVM IR contains calls of OpenCL builtins?

Yes, that's correct.

LGTM since currently there is only one HIP/SPIRV implementation. If in the future there is another HIP/SPIRV implementation that does not need this, it could disable it by triple.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 5 2022, 1:58 PM
This revision was automatically updated to reflect the committed changes.