Skip to content

Commit

Permalink
Resolve of merge (conflict) 7b7a193 Cherry pick a couple of commits t…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
3 people authored Oct 26, 2021
1 parent 2b19c10 commit bce7303
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
6 changes: 0 additions & 6 deletions test/transcoding/NoSignedUnsignedWrap.ll
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,12 @@
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM-NEGATIVE

<<<<<<< HEAD
; Check SPIR-V versions in a format magic number + version
; CHECK-SPIRV-EXT: 119734787 65536
; CHECK-SPIRV-EXT: Extension "SPV_KHR_no_integer_wrap_decoration"
; CHECK-SPIRV-NOEXT: 119734787 66560
; CHECK-SPIRV: Decorate {{[0-9]+}} NoSignedWrap
; CHECK-SPIRV: Decorate {{[0-9]+}} NoUnsignedWrap
=======
; CHECK-SPIRV: Extension "SPV_KHR_no_integer_wrap_decoration"
; CHECK-SPIRV-DAG: Decorate {{[0-9]+}} NoSignedWrap
; CHECK-SPIRV-DAG: Decorate {{[0-9]+}} NoUnsignedWrap
>>>>>>> 7b7a1932a0721d31b7517b10c0fe16c16917e888
;
; CHECK-SPIRV-NEGATIVE-NOT: Extension "SPV_KHR_no_integer_wrap_decoration"
; CHECK-SPIRV-NEGATIVE-NOT: Decorate {{[0-9]+}} NoSignedWrap
Expand Down
15 changes: 2 additions & 13 deletions test/transcoding/annotate_attribute.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,17 @@
; RUN: llvm-as %s -o %t.bc
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_fpga_memory_accesses,+SPV_INTEL_fpga_memory_attributes -spirv-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV

<<<<<<< HEAD
; Check SPIR-V versions in a format magic number + version
; CHECK-SPIRV: 119734787 65536

; CHECK-SPIRV: Decorate {{[0-9]+}} UserSemantic "42"
; CHECK-SPIRV: Decorate {{[0-9]+}} UserSemantic "bar"
; CHECK-SPIRV: Decorate {{[0-9]+}} UserSemantic "{FOO}"
; CHECK-SPIRV: Decorate {{[0-9]+}} UserSemantic "my_custom_annotations: 30, 60"
; CHECK-SPIRV: MemberDecorate {{[0-9]+}} 1 UserSemantic "128"
; CHECK-SPIRV: MemberDecorate {{[0-9]+}} 2 UserSemantic "qux"
; CHECK-SPIRV: MemberDecorate {{[0-9]+}} 0 UserSemantic "{baz}"
; CHECK-SPIRV: MemberDecorate {{[0-9]+}} 3 UserSemantic "my_custom_annotations: 20, 60, 80"
=======
; CHECK-SPIRV-DAG: Decorate {{[0-9]+}} UserSemantic "42"
; CHECK-SPIRV-DAG: Decorate {{[0-9]+}} UserSemantic "bar"
; CHECK-SPIRV-DAG: Decorate {{[0-9]+}} UserSemantic "{FOO}"
; CHECK-SPIRV-DAG: Decorate {{[0-9]+}} UserSemantic "bar"
; CHECK-SPIRV-DAG: Decorate {{[0-9]+}} UserSemantic "my_custom_annotations: 30, 60"
; CHECK-SPIRV-DAG: MemberDecorate {{[0-9]+}} 0 UserSemantic "{baz}"
; CHECK-SPIRV-DAG: MemberDecorate {{[0-9]+}} 1 UserSemantic "128"
; CHECK-SPIRV-DAG: MemberDecorate {{[0-9]+}} 2 UserSemantic "qux"
; CHECK-SPIRV-DAG: MemberDecorate {{[0-9]+}} 0 UserSemantic "{baz}"
; CHECK-SPIRV-DAG: MemberDecorate {{[0-9]+}} 3 UserSemantic "my_custom_annotations: 20, 60, 80"
>>>>>>> 7b7a1932a0721d31b7517b10c0fe16c16917e888

target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spir64-unknown-linux"
Expand Down

0 comments on commit bce7303

Please sign in to comment.