-
Notifications
You must be signed in to change notification settings - Fork 224
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
Fix translation of device execution built-ins #46
Conversation
ff34be3
to
c02362f
Compare
lib/SPIRV/SPIRVLowerOCLBlocks.cpp
Outdated
class SPIRVLowerOCLBLocks : public ModulePass { | ||
|
||
public: | ||
SPIRVLowerOCLBLocks() : ModulePass(ID) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The l of Blocks is capitalized
lib/SPIRV/CMakeLists.txt
Outdated
@@ -27,6 +27,7 @@ add_llvm_library(LLVMSPIRVLib | |||
SPIRVLowerConstExpr.cpp | |||
SPIRVLowerSPIRBlocks.cpp | |||
SPIRVLowerMemmove.cpp | |||
SPIRVLowerOCLBlocks.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we re-alphabetise this list, I'm sorry I'm a bit of a pedant :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem :)
lib/SPIRV/OCL20ToSPIRV.cpp
Outdated
@@ -236,7 +237,6 @@ class OCL20ToSPIRV : public ModulePass, public InstVisitor<OCL20ToSPIRV> { | |||
void visitCallVecLoadStore(CallInst *CI, StringRef MangledName, | |||
const std::string &DemangledName); | |||
|
|||
/// Transforms get_mem_fence built-in to SPIR-V function and aligns result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this line have been deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It's a mistake.
* Change SPIR-V Writer/Reader to consume/produce LLVM IR with blocks and device side enqueue built-ins as it is produced by clang * Improve function pointers removal related to OpenCL 2.0 blocks * Improve tests * Fix translation of literal structs
@neildhickey, I have applied your comments. Please take a look. Thanks. |
LGTM |
… in SPIR-V (KhronosGroup#9.. 'master' -> 'xmain-web' (KhronosGroup#46) CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVToLLVMDbgTran.cpp commit aa78268 Author: KornevNikita <[email protected]> Date: Mon Mar 22 18:22:21 2021 +0300 [SPIRV] Encode CodeView checksum information in SPIR-V (KhronosGroup#936) * [SPIRV] Encode CodeView checksum information in SPIR-V This is a workaround to keep CodeView checksum information throughout the translation. The idea is to store checksum kind and value to Ops[TextIdx] and then parse this string while creating DIFile. Change-Id: I9a8efbc778a908467403ab13a8568550c97fee4b
…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]>
…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]>
…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]>
…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]>
…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]>
…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]>
…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]>
device side enqueue built-ins as it is produced by clang