[llvm-branch-commits] [mlir] [MLIR][ControlFlow] Enable strict property assembly format (PR #196280)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu May 7 03:57:41 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Mehdi Amini (joker-eph)
<details>
<summary>Changes</summary>
Enable the strict properties assembly format mode for the ControlFlow dialect. The dialect formats already cover their inherent attributes, except for a test that still used attr-dict spelling for branch weights.
Update that test to use the existing weights(...) syntax so the inherent attribute is parsed through the declarative format.
Assisted-by: Codex
---
Full diff: https://github.com/llvm/llvm-project/pull/196280.diff
2 Files Affected:
- (modified) mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td (+1)
- (modified) mlir/test/Conversion/ControlFlowToLLVM/branch.mlir (+1-1)
``````````diff
diff --git a/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td b/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
index a441fd82546e3..0e4c4eb78b94b 100644
--- a/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
+++ b/mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
@@ -23,6 +23,7 @@ def ControlFlow_Dialect : Dialect {
let name = "cf";
let cppNamespace = "::mlir::cf";
let dependentDialects = ["arith::ArithDialect"];
+ let useStrictPropertiesInAssemblyFormat = 1;
let description = [{
This dialect contains low-level, i.e. non-region based, control flow
constructs. These constructs generally represent control flow directly
diff --git a/mlir/test/Conversion/ControlFlowToLLVM/branch.mlir b/mlir/test/Conversion/ControlFlowToLLVM/branch.mlir
index 7c78211d59010..a01d83b9241a6 100644
--- a/mlir/test/Conversion/ControlFlowToLLVM/branch.mlir
+++ b/mlir/test/Conversion/ControlFlowToLLVM/branch.mlir
@@ -75,7 +75,7 @@ func.func @unreachable_block() {
// CHECK-LABEL: func.func @cf_cond_br_with_weights(
func.func @cf_cond_br_with_weights(%cond: i1, %a: index, %b: index) -> index {
// CHECK: llvm.cond_br %{{.*}} weights([90, 10]), ^bb1(%{{.*}} : i64), ^bb2(%{{.*}} : i64)
- cf.cond_br %cond, ^bb1(%a : index), ^bb2(%b : index) {branch_weights = array<i32: 90, 10>}
+ cf.cond_br %cond weights([90, 10]), ^bb1(%a : index), ^bb2(%b : index)
^bb1(%arg1: index):
return %arg1 : index
^bb2(%arg2: index):
``````````
</details>
https://github.com/llvm/llvm-project/pull/196280
More information about the llvm-branch-commits
mailing list