Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate OpControlBarrier for Subgroup scope for OpenCL 1.2/2.0 #48

Merged
merged 2 commits into from
Sep 20, 2018

Conversation

AlexeySotkin
Copy link
Contributor

'cl_intel_subgroup' extension allows to use sub_group_barrier() built-in
with OpenCL 1.2/2.0. It requires to translate this built-in to
reqular (core) SPIR-V instruction OpControlBarrier.

Note: currently clag generates nothing representing vendor extensions
like 'cl_intel_subgroup'. So, SPIR-V translator doesn't check that the
extensions was enabled. It assumes that if a built-in or a type which
belong to one of supported extension used in the IR, this extensions is
enabled.

'cl_intel_subgroup' extension allows to use sub_group_barrier() built-in
with OpenCL 1.2/2.0. It requires to translate this built-in to
reqular (core) SPIR-V instruction OpControlBarrier.

Note: currently clag generates nothing representing vendor extensions
like 'cl_intel_subgroup'. So, SPIR-V translator doesn't check that the
extensions was enabled. It assumes that if a built-in or a type which
belong to one of supported extension used in the IR, this extensions is
enabled.
Copy link
Contributor

@neildhickey neildhickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@neildhickey neildhickey merged commit 831ccd6 into KhronosGroup:master Sep 20, 2018
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
…o improve llvm-spirv perf.. '"xmain"' -> '"xmain-cand"' (1 commits) (KhronosGroup#48)

  CONFLICT (content): Merge conflict in test/transcoding/annotate_attribute.ll
  CONFLICT (content): Merge conflict in test/transcoding/NoSignedUnsignedWrap.ll

  commit 7b7a193
  Author: Alexey Sotkin <[email protected]>
  Date:   Tue Oct 26 11:12:43 2021 +0300

      Cherry pick a couple of commits to improve llvm-spirv performance (KhronosGroup#46)

      * [NFC] Optimize adding of decorations (KhronosGroup#1233)

      Use std::undordered_set instead of std::multiset with custom comparator.
      It is a bit unclear why std::multiset was required since there is no
      order requirement for OpDecorate instructions in SPIR-V spec, in addition old
      data structure was highly inefficient.

      * [NFC] Optimize OCLUtil::toString usage in checkError function (KhronosGroup#1229)

      `toString` function is called to convert an LLVM IR instruction to a string,
      mostly in order to include it into an error message in case LLVM IR is invalid.
      The problem is that this function is called even when IR is valid which
      significantly slows translator's work.

      This patch reworks `toString` usage in `checkError` method to generate a string
      only in case when LLVM IR is invalid.

      Co-authored-by: Mariya Podchishchaeva <[email protected]>
      Co-authored-by: Viktoria Maximova <[email protected]>

Co-authored-by: iclsrc <[email protected]>
Co-authored-by: Artem Gindinson <[email protected]>
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
…commits to improve llvm-spirv perf.. '"xmain"' -> '"xmain-cand"' (1 commits) (KhronosGroup#48)

  CONFLICT (content): Merge conflict in test/transcoding/annotate_attribute.ll
  CONFLICT (content): Merge conflict in test/transcoding/NoSignedUnsignedWrap.ll

  commit 7b7a193
  Author: Alexey Sotkin <[email protected]>
  Date:   Tue Oct 26 11:12:43 2021 +0300

      Cherry pick a couple of commits to improve llvm-spirv performance (KhronosGroup#46)

      * [NFC] Optimize adding of decorations (KhronosGroup#1233)

      Use std::undordered_set instead of std::multiset with custom comparator.
      It is a bit unclear why std::multiset was required since there is no
      order requirement for OpDecorate instructions in SPIR-V spec, in addition old
      data structure was highly inefficient.

      * [NFC] Optimize OCLUtil::toString usage in checkError function (KhronosGroup#1229)

      `toString` function is called to convert an LLVM IR instruction to a string,
      mostly in order to include it into an error message in case LLVM IR is invalid.
      The problem is that this function is called even when IR is valid which
      significantly slows translator's work.

      This patch reworks `toString` usage in `checkError` method to generate a string
      only in case when LLVM IR is invalid.

      Co-authored-by: Mariya Podchishchaeva <[email protected]>
      Co-authored-by: Viktoria Maximova <[email protected]>

Co-authored-by: iclsrc <[email protected]>
Co-authored-by: Artem Gindinson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants