-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[acc][mlir] Add 'if-condition' to 'atomic' operations. #164003
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 1 commit
b8be187
d0954c4
678f05b
93f88d5
7811e4a
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 |
---|---|---|
|
@@ -2787,10 +2787,16 @@ def AtomicReadOp : OpenACC_Op<"atomic.read", [AtomicReadOpInterface]> { | |
|
||
let arguments = (ins OpenACC_PointerLikeType:$x, | ||
OpenACC_PointerLikeType:$v, | ||
TypeAttr:$element_type); | ||
TypeAttr:$element_type, | ||
Optional<I1>:$ifCond | ||
); | ||
|
||
let assemblyFormat = [{ | ||
oilist( | ||
`if` `(` $ifCond `)` | ||
) | ||
$v `=` $x | ||
`:` type($v) `,` type($x) `,` $element_type attr-dict | ||
`:` type($v) `,` type($x) `,` $element_type | ||
attr-dict | ||
}]; | ||
let hasVerifier = 1; | ||
} | ||
|
@@ -2809,8 +2815,12 @@ def AtomicWriteOp : OpenACC_Op<"atomic.write",[AtomicWriteOpInterface]> { | |
}]; | ||
|
||
let arguments = (ins OpenACC_PointerLikeType:$x, | ||
AnyType:$expr); | ||
AnyType:$expr, | ||
Optional<I1>:$ifCond); | ||
let assemblyFormat = [{ | ||
oilist( | ||
`if` `(` $ifCond `)` | ||
) | ||
$x `=` $expr | ||
`:` type($x) `,` type($expr) | ||
attr-dict | ||
|
@@ -2850,10 +2860,15 @@ def AtomicUpdateOp : OpenACC_Op<"atomic.update", | |
|
||
let arguments = (ins Arg<OpenACC_PointerLikeType, | ||
"Address of variable to be updated", | ||
[MemRead, MemWrite]>:$x); | ||
[MemRead, MemWrite]>:$x, | ||
Optional<I1>:$ifCond); | ||
|
||
let regions = (region SizedRegion<1>:$region); | ||
let assemblyFormat = [{ | ||
$x `:` type($x) $region attr-dict | ||
oilist( | ||
`if` `(` $ifCond `)` | ||
) | ||
$x `:` type($x) | ||
$region attr-dict | ||
}]; | ||
let hasVerifier = 1; | ||
let hasRegionVerifier = 1; | ||
|
@@ -2896,8 +2911,13 @@ def AtomicCaptureOp : OpenACC_Op<"atomic.capture", | |
|
||
}]; | ||
|
||
let arguments = (ins Optional<I1>:$ifCond); | ||
|
||
let regions = (region SizedRegion<1>:$region); | ||
let assemblyFormat = [{ | ||
oilist( | ||
`if` `(` $ifCond `)` | ||
) | ||
$region attr-dict | ||
}]; | ||
let hasRegionVerifier = 1; | ||
|
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.
nit: Here and below - should it be
ifCond
instead ofIfCond
?