Skip to content

[mlir][cf] fix 'switch', 'assert' and 'cond_br' operations' description #101319

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 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def AssertOp : CF_Op<"assert",
Example:

```mlir
assert %b, "Expected ... to be true"
cf.assert %b, "Expected ... to be true"
```
}];

Expand Down Expand Up @@ -118,7 +118,7 @@ def CondBranchOp : CF_Op<"cond_br",
Pure, Terminator]> {
let summary = "conditional branch operation";
let description = [{
The `cond_br` terminator operation represents a conditional branch on a
The `cf.cond_br` terminator operation represents a conditional branch on a
boolean (1-bit integer) value. If the bit is set, then the first destination
is jumped to; if it is false, the second destination is chosen. The count
and types of operands must align with the arguments in the corresponding
Expand All @@ -136,7 +136,7 @@ def CondBranchOp : CF_Op<"cond_br",
```mlir
func.func @select(%a: i32, %b: i32, %flag: i1) -> i32 {
// Both targets are the same, operands differ
cond_br %flag, ^bb1(%a : i32), ^bb1(%b : i32)
cf.cond_br %flag, ^bb1(%a : i32), ^bb1(%b : i32)

^bb1(%x : i32) :
return %x : i32
Expand Down Expand Up @@ -233,7 +233,7 @@ def SwitchOp : CF_Op<"switch",
Pure, Terminator]> {
let summary = "switch operation";
let description = [{
The `switch` terminator operation represents a switch on a signless integer
The `cf.switch` terminator operation represents a switch on a signless integer
value. If the flag matches one of the specified cases, then the
corresponding destination is jumped to. If the flag does not match any of
the cases, the default destination is jumped to. The count and types of
Expand All @@ -242,7 +242,7 @@ def SwitchOp : CF_Op<"switch",
Example:

```mlir
switch %flag : i32, [
cf.switch %flag : i32, [
default: ^bb1(%a : i32),
42: ^bb1(%b : i32),
43: ^bb3(%c : i32)
Expand Down
Loading