-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AMDGCN] Error checking for llvm.amdgcn.init.exec.from.input intrinsic #128176
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
Closed
Closed
Changes from all commits
Commits
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
40 changes: 40 additions & 0 deletions
40
llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-intrinsic-initexecfrominput.ll
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,40 @@ | ||
; RUN: not llc -mtriple=amdgcn -mcpu=gfx942 -O3 -global-isel=true -o - %s 2>&1 | FileCheck -check-prefix=ERR %s | ||
|
||
source_filename = "llvm.amdgcn.init.exec.wave32.ll" | ||
|
||
@G = global i32 -2147483648 | ||
@G.1 = global <32 x i32> splat (i32 1) | ||
@G.2 = global <16 x i64> splat (i64 1) | ||
@G.3 = global <8 x i1> zeroinitializer | ||
|
||
define amdgpu_ps float @test_init_exec(float %a, float %b) { | ||
main_body: | ||
%s = fadd float %a, %b | ||
call void @llvm.amdgcn.init.exec(i64 74565) | ||
ret float %s | ||
} | ||
|
||
define amdgpu_ps float @test_init_exec_from_input(i32 inreg %0, i32 inreg %1, i32 inreg %2, i32 inreg %count, float %a, float %b) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should have failed the IR verifier |
||
main_body: | ||
%LGV2 = load <16 x i64>, ptr @G.2, align 128 | ||
%LGV1 = load <32 x i32>, ptr @G.1, align 128 | ||
%LGV = load i32, ptr @G, align 4 | ||
%C = call <8 x i1> @f(<32 x i32> %LGV1, <16 x i64> %LGV2, <2 x half> splat (half 0xH5140)) | ||
%B = or i32 0, %LGV | ||
%s = fadd float %a, %b | ||
call void @llvm.amdgcn.init.exec.from.input(i32 %B, i32 8) | ||
store <8 x i1> %C, ptr @G.3, align 1 | ||
ret float %s | ||
} | ||
|
||
; Function Attrs: convergent nocallback nofree nounwind willreturn | ||
declare void @llvm.amdgcn.init.exec(i64 immarg) #0 | ||
|
||
; Function Attrs: convergent nocallback nofree nounwind willreturn | ||
declare void @llvm.amdgcn.init.exec.from.input(i32, i32 immarg) #0 | ||
|
||
declare <8 x i1> @f(<32 x i32>, <16 x i64>, <2 x half>) | ||
|
||
attributes #0 = { convergent nocallback nofree nounwind willreturn } | ||
|
||
ERR: error: <unknown>:0:0: in function test_init_exec_from_input float (i32, i32, i32, i32, float, float): EXEC must be initialized using function argument |
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,40 @@ | ||
; RUN: not llc -mtriple=amdgcn -mcpu=gfx942 -O3 -global-isel=false -o - %s 2>&1 | FileCheck -check-prefix=ERR %s | ||
|
||
source_filename = "llvm.amdgcn.init.exec.wave32.ll" | ||
|
||
@G = global i32 -2147483648 | ||
@G.1 = global <32 x i32> splat (i32 1) | ||
@G.2 = global <16 x i64> splat (i64 1) | ||
@G.3 = global <8 x i1> zeroinitializer | ||
|
||
define amdgpu_ps float @test_init_exec(float %a, float %b) { | ||
main_body: | ||
%s = fadd float %a, %b | ||
call void @llvm.amdgcn.init.exec(i64 74565) | ||
ret float %s | ||
} | ||
|
||
define amdgpu_ps float @test_init_exec_from_input(i32 inreg %0, i32 inreg %1, i32 inreg %2, i32 inreg %count, float %a, float %b) { | ||
main_body: | ||
%LGV2 = load <16 x i64>, ptr @G.2, align 128 | ||
%LGV1 = load <32 x i32>, ptr @G.1, align 128 | ||
%LGV = load i32, ptr @G, align 4 | ||
%C = call <8 x i1> @f(<32 x i32> %LGV1, <16 x i64> %LGV2, <2 x half> splat (half 0xH5140)) | ||
%B = or i32 0, %LGV | ||
%s = fadd float %a, %b | ||
call void @llvm.amdgcn.init.exec.from.input(i32 %B, i32 8) | ||
store <8 x i1> %C, ptr @G.3, align 1 | ||
ret float %s | ||
} | ||
|
||
; Function Attrs: convergent nocallback nofree nounwind willreturn | ||
declare void @llvm.amdgcn.init.exec(i64 immarg) #0 | ||
|
||
; Function Attrs: convergent nocallback nofree nounwind willreturn | ||
declare void @llvm.amdgcn.init.exec.from.input(i32, i32 immarg) #0 | ||
|
||
declare <8 x i1> @f(<32 x i32>, <16 x i64>, <2 x half>) | ||
|
||
attributes #0 = { convergent nocallback nofree nounwind willreturn } | ||
|
||
ERR: error: <unknown>:0:0: in function test_init_exec_from_input float (i32, i32, i32, i32, float, float): EXEC must be initialized using function argument |
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.
This belongs in the machine verifier, and does not need to be a proper error
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.
Do we really need machine verification of this? I think the IR would be enough