-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[MLIR][NVVM] Update Op verifiers to prevent ungraceful exits #165677
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
Wolfram70
merged 8 commits into
llvm:main
from
Wolfram70:dev/Wolfram70/mlir-ungraceful-exit
Nov 4, 2025
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f566fa7
[MLIR][NVVM] Update Op verifiers to prevent ungraceful exits
Wolfram70 045ce6c
fix formatting
Wolfram70 70fe4cc
address comments
Wolfram70 29aa80e
fix formatting
Wolfram70 867f33c
update and refactor shfl.sync Op verifier
Wolfram70 9241b6a
refactor shfl.sync verifier
Wolfram70 4c722d4
address comments
Wolfram70 b686b44
update punctuation in error message
Wolfram70 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
Some comments aren't visible on the classic Files Changed page.
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
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,22 @@ | ||
| // RUN: mlir-translate -verify-diagnostics -split-input-file -mlir-to-llvmir %s | ||
|
|
||
| // ----- | ||
|
|
||
| func.func @nvvm_invalid_shfl_pred(%arg0 : i32, %arg1 : f32, %arg2 : i32, %arg3 : i32) { | ||
| // expected-error@+1 {{"return_value_and_is_valid" attribute must be specified when the return type is a struct type}} | ||
| %0 = nvvm.shfl.sync bfly %arg0, %arg1, %arg2, %arg3 : f32 -> !llvm.struct<(f32, i1)> | ||
| } | ||
|
|
||
| // ----- | ||
|
|
||
| func.func @nvvm_invalid_shfl_invalid_return_type_1(%arg0 : i32, %arg1 : f32, %arg2 : i32, %arg3 : i32) { | ||
| // expected-error@+1 {{expected return type to be of type 'f32' but got 'i32' instead.}} | ||
| %0 = nvvm.shfl.sync bfly %arg0, %arg1, %arg2, %arg3 : f32 -> i32 | ||
| } | ||
|
|
||
| // ----- | ||
|
|
||
| func.func @nvvm_invalid_shfl_invalid_return_type_2(%arg0 : i32, %arg1 : f32, %arg2 : i32, %arg3 : i32) { | ||
| // expected-error@+1 {{expected first element in the returned struct to be of type 'f32' but got 'i32' instead.}} | ||
| %0 = nvvm.shfl.sync bfly %arg0, %arg1, %arg2, %arg3 {return_value_and_is_valid} : f32 -> !llvm.struct<(i32, i1)> | ||
| } |
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,9 @@ | ||
| // RUN: mlir-translate -verify-diagnostics -split-input-file -mlir-to-llvmir %s | ||
|
|
||
| // ----- | ||
|
|
||
| llvm.func @nvvm_tcgen05_ld_32x32b_offset(%tmemAddr : !llvm.ptr<6>, %offset : i64) -> () { | ||
| // expected-error@+1 {{offset argument is only supported for shape 16x32bx2}} | ||
| %ldv2 = nvvm.tcgen05.ld %tmemAddr, %offset { pack, shape = #nvvm.tcgen05_ldst_shape<shape_32x32b>} : vector<2 x i32> | ||
| llvm.return | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.