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

[NFC] Optimize adding of decorations #1233

Merged
merged 5 commits into from
Oct 11, 2021

Conversation

Fznamznon
Copy link
Contributor

@Fznamznon Fznamznon commented Oct 6, 2021

Use std::vector 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.

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.

protected:
SPIRVDecorateSet Decorations;
SPIRVDecorateVec Decorations;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The patch changes only name here. I think the problem that clang-tidy complains about is out of scope of this patch.

@AlexeySachkov AlexeySachkov added the hacktoberfest-accepted Temporary label to mark merged PRs so they count towards Hacktoberfest challenge. label Oct 8, 2021
@AlexeySotkin AlexeySotkin merged commit d56378e into KhronosGroup:master Oct 11, 2021
Quetzonarch pushed a commit to Quetzonarch/SPIRV-LLVM-Translator that referenced this pull request Jul 13, 2022
* [NFC] Optimize adding of decorations

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.
vmaksimo added a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
…ronosGroup#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]>
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
…lvm-spirv perf.. '"xmain"' -> '"xmain-cand"' (1 commits)

  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]>
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]>
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
…lvm-spirv perf.. '"xmain"' -> '"xmain-web"' (7 commits)

  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]>
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
…o improve llvm-spirv perf.. '"xmain"' -> '"xmain-web"' (7 commits) (KhronosGroup#49)

* Resolve of merge (conflict) 7b7a193 Cherry pick a couple of commits to improve llvm-spirv perf.. '"xmain"' -> '"xmain-web"' (7 commits)

  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]>

* Resolve of merge (conflict) 7b7a193 Cherry pick a couple of commits to improve llvm-spirv perf.. '"xmain"' -> '"xmain-web"' (7 commits)

  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]>
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-web"' (7 commits) (KhronosGroup#49)

* Resolve of merge (conflict) 7b7a193 Cherry pick a couple of commits to improve llvm-spirv perf.. '"xmain"' -> '"xmain-web"' (7 commits)

  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]>

* Resolve of merge (conflict) 7b7a193 Cherry pick a couple of commits to improve llvm-spirv perf.. '"xmain"' -> '"xmain-web"' (7 commits)

  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]>
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 27, 2023
* [NFC] Optimize adding of decorations

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.
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 27, 2023
* [NFC] Optimize adding of decorations

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.
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 27, 2023
* [NFC] Optimize adding of decorations

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.
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 27, 2023
* [NFC] Optimize adding of decorations

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.
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 27, 2023
* [NFC] Optimize adding of decorations

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.
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 27, 2023
* [NFC] Optimize adding of decorations

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.
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 27, 2023
* [NFC] Optimize adding of decorations

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.
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 28, 2023
* [NFC] Optimize adding of decorations

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.
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 28, 2023
* [NFC] Optimize adding of decorations

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.
MrSidims pushed a commit that referenced this pull request Mar 28, 2023
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.

Co-authored-by: Mariya Podchishchaeva <[email protected]>
MrSidims pushed a commit that referenced this pull request Mar 28, 2023
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.

Co-authored-by: Mariya Podchishchaeva <[email protected]>
MrSidims pushed a commit that referenced this pull request Mar 28, 2023
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.

Co-authored-by: Mariya Podchishchaeva <[email protected]>
MrSidims pushed a commit that referenced this pull request Mar 28, 2023
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.

Co-authored-by: Mariya Podchishchaeva <[email protected]>
aratajew pushed a commit to aratajew/SPIRV-LLVM-Translator that referenced this pull request Mar 28, 2023
* [NFC] Optimize adding of decorations

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.
MrSidims pushed a commit that referenced this pull request Mar 29, 2023
* [NFC] Optimize adding of decorations

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Temporary label to mark merged PRs so they count towards Hacktoberfest challenge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants