-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[AMDGPU] Add verification for amdgcn.init.exec.from.input #128172
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
Changes from 4 commits
dda8be4
c6f3b88
aa34d1e
7d2779e
f291bc6
cdee5fc
bf2abb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ; RUN: not llvm-as -disable-output 2>&1 %s | FileCheck %s | ||
|
|
||
| ; Function Attrs: convergent nocallback nofree nounwind willreturn | ||
| declare void @llvm.amdgcn.init.exec.from.input(i32, i32 immarg) #0 | ||
| attributes #0 = { convergent nocallback nofree nounwind willreturn } | ||
|
|
||
| ; CHECK: only inreg arguments to the parent function are valid as inputs to this intrinsic | ||
| ; CHECK-NEXT: call void @llvm.amdgcn.init.exec.from.input(i32 0, i32 0) | ||
| define void @init_exec_from_input_fail_immarg(i32 inreg %a, i32 %b) { | ||
| call void @llvm.amdgcn.init.exec.from.input(i32 0, i32 0) | ||
arsenm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ret void | ||
| } | ||
|
|
||
| ; CHECK: only inreg arguments to the parent function are valid as inputs to this intrinsic | ||
| ; CHECK-NEXT: call void @llvm.amdgcn.init.exec.from.input(i32 %b, i32 0) | ||
| define void @init_exec_from_input_fail_not_inreg(i32 inreg %a, i32 %b) { | ||
| call void @llvm.amdgcn.init.exec.from.input(i32 %b, i32 0) | ||
| ret void | ||
| } | ||
|
Contributor
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. Also test a case where it's not an argument (try one with a constant and one with an instruction)
Contributor
Author
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. Thanks, I added another check for the case that the operand is an instruction! |
||
|
|
||
| ; CHECK: only inreg arguments to the parent function are valid as inputs to this intrinsic | ||
| ; CHECK-NEXT: call void @llvm.amdgcn.init.exec.from.input(i32 %c, i32 0) | ||
| define void @init_exec_from_input_fail_constant(i32 inreg %a, i32 %b) { | ||
arsenm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| %c = add i32 %a, %b | ||
| call void @llvm.amdgcn.init.exec.from.input(i32 %c, i32 0) | ||
| ret void | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.