-
Notifications
You must be signed in to change notification settings - Fork 768
[SYCL][ESIMD] Fix the crash in sycl-post-link while processing global spirv functions. #7590
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
; RUN: sycl-post-link -split-esimd -lower-esimd -O2 -S %s -o %t.table | ||
; RUN: FileCheck %s -input-file=%t_esimd_0.ll | ||
; This test checks that IR code below can be successfully processed by | ||
; sycl-post-link. In this IR no extractelement instruction and no casting are used | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" | ||
target triple = "spir64-unknown-unknown" | ||
|
||
@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32 | ||
|
||
; Function Attrs: convergent norecurse | ||
define dso_local spir_kernel void @ESIMD_kernel() #0 !sycl_explicit_simd !3 { | ||
entry: | ||
%0 = load i64, i64 addrspace(1)* getelementptr (<3 x i64>, <3 x i64> addrspace(1)* @__spirv_BuiltInGlobalInvocationId, i64 0, i64 0), align 32 | ||
%conv = trunc i64 %0 to i32 | ||
ret void | ||
} | ||
|
||
attributes #0 = { "sycl-module-id"="a.cpp" } | ||
|
||
!llvm.module.flags = !{!0} | ||
!opencl.spir.version = !{!1} | ||
!spirv.Source = !{!2} | ||
|
||
!0 = !{i32 1, !"wchar_size", i32 4} | ||
!1 = !{i32 1, i32 2} | ||
!2 = !{i32 0, i32 100000} | ||
!3 = !{} | ||
|
||
; CHECK: define dso_local spir_kernel void @ESIMD_kernel() | ||
; CHECK: call <3 x i32> @llvm.genx.local.id.v3i32() | ||
; CHECK: call <3 x i32> @llvm.genx.local.size.v3i32() | ||
; CHECK: call i32 @llvm.genx.group.id.x() | ||
; CHECK: ret void | ||
; CHECK: } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Sorry for being late for the review, I don't see such restrictions in SPIR-V spec, could you please help me finding it?
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.
These restrictions are to protect the code to make sure it processes only the code it is expected to process and not to enforce SPIR-V spec.