[Mlir-commits] [mlir] [mlir][cf] fix 'cf.switch' operation description (PR #101319)

Andrey Timonin llvmlistbot at llvm.org
Wed Jul 31 04:59:43 PDT 2024


https://github.com/EtoAndruwa updated https://github.com/llvm/llvm-project/pull/101319

>From 4dca2064ccbf9465d0384a70d69b61f1292c6df2 Mon Sep 17 00:00:00 2001
From: EtoAndruwa <timonina1909 at gmail.com>
Date: Wed, 31 Jul 2024 13:39:28 +0300
Subject: [PATCH 1/2] [mlir][cf] fix 'cf.switch' operation description

---
 mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td b/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
index 181bc5a2d07fa..a26bf75d9d12c 100644
--- a/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
+++ b/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
@@ -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
@@ -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)

>From 697f3791965a2a09cd5d528738003a496cf3cfc3 Mon Sep 17 00:00:00 2001
From: EtoAndruwa <timonina1909 at gmail.com>
Date: Wed, 31 Jul 2024 14:59:31 +0300
Subject: [PATCH 2/2] [mlir][cf] fix  and  operation description

---
 mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td b/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
index a26bf75d9d12c..3bdbfb0fedb9c 100644
--- a/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
+++ b/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
@@ -50,7 +50,7 @@ def AssertOp : CF_Op<"assert",
     Example:
 
     ```mlir
-    assert %b, "Expected ... to be true"
+    cf.assert %b, "Expected ... to be true"
     ```
   }];
 
@@ -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
@@ -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



More information about the Mlir-commits mailing list