[Mlir-commits] [mlir] [mlir][tosa] Add assembly format for CONST (PR #225668)

Yuvaraj Venkatesh llvmlistbot at llvm.org
Wed Sep 23 03:22:24 PDT 2026


https://github.com/Yuvaraj-Venkatesh created https://github.com/llvm/llvm-project/pull/225668

This commit adds an assembly format for the TOSA CONST operation. Previously, the generic assembly format was used while all other operations had a custom format. It takes advantage of the incoming textual format changes in #217291, to minimise impact to downstream consumers.


>From 2540e79e5b90c44981ffbb50b9322b783ce4b660 Mon Sep 17 00:00:00 2001
From: Yuvaraj Venkatesh <yuvaraj.venkatesh at arm.com>
Date: Wed, 23 Sep 2026 08:56:08 +0000
Subject: [PATCH] [mlir][tosa] Add assembly format for CONST

This commit adds an assembly format for the TOSA CONST operation. Previously, the generic assembly format was used while all other operations had a custom format. It takes advantage of the incoming textual format changes in #217291, to minimise impact to downstream consumers.

Change-Id: If28506f00e26a1e65ef9c45aac9ea04e5e6d600d
---
 mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td  |  4 ++++
 .../TosaToSPIRVTosa/graph-constant-mark.mlir  |  6 ++---
 mlir/test/Dialect/Tosa/canonicalize.mlir      | 18 +++++++--------
 mlir/test/Dialect/Tosa/constant_folding.mlir  |  4 ++--
 mlir/test/Dialect/Tosa/ops.mlir               |  2 +-
 .../Tosa/tosa-arith-const-to-tosa-const.mlir  | 16 +++++++-------
 ...tosa-convert-integer-type-to-signless.mlir | 12 +++++-----
 .../Tosa/tosa-decompose-depthwise.mlir        |  2 +-
 mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir | 10 ++++-----
 .../Tosa/tosa-layerwise-constant-fold.mlir    |  4 ++--
 .../tosa-narrow-f64-to-f32-aggressive.mlir    |  4 ++--
 .../Dialect/Tosa/tosa-narrow-f64-to-f32.mlir  |  4 ++--
 .../tosa-narrow-i64-to-i32-aggressive.mlir    |  4 ++--
 .../Dialect/Tosa/tosa-narrow-i64-to-i32.mlir  |  4 ++--
 .../Dialect/Tosa/tosa-reduce-transposes.mlir  | 22 +++++++++----------
 15 files changed, 60 insertions(+), 56 deletions(-)

diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
index 7cbe8e0b6c70e7..01ef662cc4f71e 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
@@ -2700,6 +2700,10 @@ def Tosa_ConstOp : Tosa_Op<"const", [ConstantLike, Pure,
 
   let hasFolder = 1;
   let hasVerifier = 1;
+
+  let assemblyFormat =
+      "operands `values` `(` $values `)` attr-dict `:` "
+      "functional-type(operands, results)";
 }
 
 //===----------------------------------------------------------------------===//
diff --git a/mlir/test/Conversion/TosaToSPIRVTosa/graph-constant-mark.mlir b/mlir/test/Conversion/TosaToSPIRVTosa/graph-constant-mark.mlir
index ceab987ab08b57..11a128f2b3b6e6 100644
--- a/mlir/test/Conversion/TosaToSPIRVTosa/graph-constant-mark.mlir
+++ b/mlir/test/Conversion/TosaToSPIRVTosa/graph-constant-mark.mlir
@@ -2,7 +2,7 @@
 
 // CHECK-LABEL: func.func @large_const
 func.func @large_const() -> tensor<17xi32> {
-  // CHECK: "tosa.const"() <{values = {{.*}}> {grapharm.graph_constant_id = 0 : i32} : () -> tensor<17xi32>
+  // CHECK: tosa.const values({{.*}}) {grapharm.graph_constant_id = 0 : i32} : () -> tensor<17xi32>
   %res = "tosa.const"() <{values = dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]> : tensor<17xi32>}> : () -> tensor<17xi32>
   return %res : tensor<17xi32>
 }
@@ -38,9 +38,9 @@ func.func @small_const_shape() -> !tosa.shape<32> {
 
 // CHECK-LABEL: func.func @mixed_large_constants
 func.func @mixed_large_constants() -> (tensor<17xi32>, tensor<18xi32>, !tosa.shape<33>) {
-  // CHECK: "tosa.const"() <{values = {{.*}}> {grapharm.graph_constant_id = 0 : i32} : () -> tensor<17xi32>
+  // CHECK: tosa.const values({{.*}}) {grapharm.graph_constant_id = 0 : i32} : () -> tensor<17xi32>
   %const0 = "tosa.const"() <{values = dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]> : tensor<17xi32>}> : () -> tensor<17xi32>
-  // CHECK: "tosa.const"() <{values = {{.*}}> {grapharm.graph_constant_id = 1 : i32} : () -> tensor<18xi32>
+  // CHECK: tosa.const values({{.*}}) {grapharm.graph_constant_id = 1 : i32} : () -> tensor<18xi32>
   %const1 = "tosa.const"() <{values = dense<[20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37]> : tensor<18xi32>}> : () -> tensor<18xi32>
   // CHECK: tosa.const_shape values({{.*}}) {grapharm.graph_constant_id = 2 : i32} : () -> !tosa.shape<33>
   %shape = "tosa.const_shape"() <{values = dense<[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]> : tensor<33xindex>}> : () -> !tosa.shape<33>
diff --git a/mlir/test/Dialect/Tosa/canonicalize.mlir b/mlir/test/Dialect/Tosa/canonicalize.mlir
index 22353d1a756565..4ce983d11252f7 100644
--- a/mlir/test/Dialect/Tosa/canonicalize.mlir
+++ b/mlir/test/Dialect/Tosa/canonicalize.mlir
@@ -1077,7 +1077,7 @@ func.func @canonicalize_concat_slice_on_non_concat_axis(%arg0 : tensor<1x12x12xf
 // -----
 
 // CHECK-LABEL: @canonicalize_pad_slice_overlap
-// CHECK-DAG: %[[PAD_CONST:.*]] = "tosa.const"() <{values = dense<0.000000e+00> : tensor<1xf32>}> : () -> tensor<1xf32>
+// CHECK-DAG: %[[PAD_CONST:.*]] = tosa.const values(dense<0.000000e+00> : tensor<1xf32>) : () -> tensor<1xf32>
 // CHECK-DAG: %[[ZERO:.*]] = tosa.const_shape values(dense<0> : tensor<4xindex>) : () -> !tosa.shape<4>
 // CHECK-DAG: %[[PADDING:.*]] = tosa.const_shape values(dense<[0, 0, 0, 0, 1, 1, 0, 0]> : tensor<8xindex>)
 // CHECK-DAG: %[[SLICE_SIZE:.*]] = tosa.const_shape values(dense<[-1, 14, 18, 3]> : tensor<4xindex>)
@@ -1113,7 +1113,7 @@ func.func @canonicalize_pad_slice_inside(%arg0: tensor<1x16x16x3xf32>) -> tensor
 // -----
 
 // CHECK-LABEL: func @canonicalize_pad_slice_exact
-// CHECK-DAG: %[[PAD_CONST:.*]] = "tosa.const"() <{values = dense<0.000000e+00> : tensor<1xf32>}> : () -> tensor<1xf32>
+// CHECK-DAG: %[[PAD_CONST:.*]] = tosa.const values(dense<0.000000e+00> : tensor<1xf32>) : () -> tensor<1xf32>
 // CHECK-DAG: %[[ZERO:.*]] = tosa.const_shape values(dense<0> : tensor<4xindex>) : () -> !tosa.shape<4>
 // CHECK-DAG: %[[PADDING:.*]] = tosa.const_shape values(dense<[0, 0, 0, 0, 2, 2, 0, 0]> : tensor<8xindex>)
 // CHECK-DAG: %[[SLICE_SIZE:.*]] = tosa.const_shape values(dense<[1, 16, 20, 2]> : tensor<4xindex>)
@@ -1403,7 +1403,7 @@ func.func @slice_dynamic_size_static_output_canonicalize(%arg0: tensor<2x60x59x?
 // -----
 
 // CHECK-LABEL: @fold_mul_shift
-// CHECK-DAG: "tosa.const"() <{values = dense<1> : tensor<i32>}> : () -> tensor<i32>
+// CHECK-DAG: tosa.const values(dense<1> : tensor<i32>) : () -> tensor<i32>
 func.func @fold_mul_shift() -> tensor<i32> {
     %0 = "tosa.const"() <{values = dense<-23661> : tensor<i32>}> : () -> tensor<i32>
     %1 = "tosa.const"() <{values = dense<-33022> : tensor<i32>}> : () -> tensor<i32>
@@ -1415,7 +1415,7 @@ func.func @fold_mul_shift() -> tensor<i32> {
 // -----
 
 // CHECK-LABEL: @fold_mul_no_shift
-// CHECK-DAG: "tosa.const"() <{values = dense<781333542> : tensor<i32>}> : () -> tensor<i32>
+// CHECK-DAG: tosa.const values(dense<781333542> : tensor<i32>) : () -> tensor<i32>
 func.func @fold_mul_no_shift() -> tensor<i32> {
     %0 = "tosa.const"() <{values = dense<-23661> : tensor<i32>}> : () -> tensor<i32>
     %1 = "tosa.const"() <{values = dense<-33022> : tensor<i32>}> : () -> tensor<i32>
@@ -1427,9 +1427,9 @@ func.func @fold_mul_no_shift() -> tensor<i32> {
 // -----
 
 // CHECK-LABEL: @no_fold_mul_result_exceeds_i32
-// CHECK-DAG: %[[LHS:.*]] = "tosa.const"() <{values = dense<23661> : tensor<i32>}> : () -> tensor<i32>
-// CHECK-DAG: %[[RHS:.*]] = "tosa.const"() <{values = dense<330222> : tensor<i32>}> : () -> tensor<i32>
-// CHECK-DAG: %[[SHIFT:.*]] = "tosa.const"() <{values = dense<1> : tensor<1xi8>}> : () -> tensor<1xi8>
+// CHECK-DAG: %[[LHS:.*]] = tosa.const values(dense<23661> : tensor<i32>) : () -> tensor<i32>
+// CHECK-DAG: %[[RHS:.*]] = tosa.const values(dense<330222> : tensor<i32>) : () -> tensor<i32>
+// CHECK-DAG: %[[SHIFT:.*]] = tosa.const values(dense<1> : tensor<1xi8>) : () -> tensor<1xi8>
 // CHECK: tosa.mul %[[LHS]], %[[RHS]], %[[SHIFT]] : (tensor<i32>, tensor<i32>, tensor<1xi8>) -> tensor<i32>
 func.func @no_fold_mul_result_exceeds_i32() -> tensor<i32> {
     %0 = "tosa.const"() <{values = dense<23661> : tensor<i32>}> : () -> tensor<i32>
@@ -1467,7 +1467,7 @@ func.func @no_fold_intdiv_dynamic_result() -> tensor<?xi32> {
 // -----
 
 // CHECK-LABEL: @test_fold_i1_to_i32_cast
-// CHECK: %[[OUT:.*]] = "tosa.const"() <{values = dense<1> : tensor<i32>}> : () -> tensor<i32>
+// CHECK: %[[OUT:.*]] = tosa.const values(dense<1> : tensor<i32>) : () -> tensor<i32>
 // CHECK: return %[[OUT]] : tensor<i32>
 func.func @test_fold_i1_to_i32_cast() -> tensor<i32> {
   %0 = "tosa.const"() <{values = dense<1> : tensor<i1>}> : () -> tensor<i1>
@@ -1478,7 +1478,7 @@ func.func @test_fold_i1_to_i32_cast() -> tensor<i32> {
 // -----
 
 // CHECK-LABEL: @test_fold_i32_to_i1_cast
-// CHECK: %[[OUT:.*]] = "tosa.const"() <{values = dense<true> : tensor<i1>}> : () -> tensor<i1>
+// CHECK: %[[OUT:.*]] = tosa.const values(dense<true> : tensor<i1>) : () -> tensor<i1>
 // CHECK: return %[[OUT]] : tensor<i1>
 func.func @test_fold_i32_to_i1_cast() -> tensor<i1> {
   %0 = "tosa.const"() <{values = dense<10> : tensor<i32>}> : () -> tensor<i32>
diff --git a/mlir/test/Dialect/Tosa/constant_folding.mlir b/mlir/test/Dialect/Tosa/constant_folding.mlir
index eb339d09d77d84..2778360289d8a2 100644
--- a/mlir/test/Dialect/Tosa/constant_folding.mlir
+++ b/mlir/test/Dialect/Tosa/constant_folding.mlir
@@ -556,8 +556,8 @@ func.func @fold_mul_zero_broadcast(%arg0: tensor<2x3xf32>) -> (tensor<2x3xf32>,
 
 // CHECK-LABEL: @fold_mul_zero_dynamic_nofold
 // CHECK-SAME:                    %[[ARG0:.*]]: tensor<?x17xf32>) -> tensor<?x17xf32> {
-// CHECK:           %[[ZERO:.*]] = "tosa.const"() <{values = dense<0.000000e+00> : tensor<1x1xf32>}> : () -> tensor<1x1xf32>
-// CHECK:           %[[SHIFT:.*]] = "tosa.const"() <{values = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
+// CHECK:           %[[ZERO:.*]] = tosa.const values(dense<0.000000e+00> : tensor<1x1xf32>) : () -> tensor<1x1xf32>
+// CHECK:           %[[SHIFT:.*]] = tosa.const values(dense<0> : tensor<1xi8>) : () -> tensor<1xi8>
 // CHECK:           %[[MUL:.*]] = tosa.mul %[[ARG0]], %[[ZERO]], %[[SHIFT]] : (tensor<?x17xf32>, tensor<1x1xf32>, tensor<1xi8>) -> tensor<?x17xf32>
 // CHECK:           return %[[MUL]]
 func.func @fold_mul_zero_dynamic_nofold(%arg0: tensor<?x17xf32>) -> tensor<?x17xf32> {
diff --git a/mlir/test/Dialect/Tosa/ops.mlir b/mlir/test/Dialect/Tosa/ops.mlir
index 2c61d9c0dc3769..12afad7a9276fa 100644
--- a/mlir/test/Dialect/Tosa/ops.mlir
+++ b/mlir/test/Dialect/Tosa/ops.mlir
@@ -1336,7 +1336,7 @@ func.func @test_rescale_i16_rounding_mode(%arg0 : tensor<2xi8>) -> tensor<2xi16>
 // -----
 // CHECK-LABEL: const
 func.func @test_const(%arg0 : index) -> tensor<4xi32> {
-    %0 = "tosa.const"() <{values = dense<[3, 0, 1, 2]> : tensor<4xi32>}> : () -> tensor<4xi32>
+    %0 = tosa.const values(dense<[3, 0, 1, 2]> : tensor<4xi32>) : () -> tensor<4xi32>
     return %0 : tensor<4xi32>
 }
 
diff --git a/mlir/test/Dialect/Tosa/tosa-arith-const-to-tosa-const.mlir b/mlir/test/Dialect/Tosa/tosa-arith-const-to-tosa-const.mlir
index 79219510a239fa..7f6dfed92a57fa 100644
--- a/mlir/test/Dialect/Tosa/tosa-arith-const-to-tosa-const.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-arith-const-to-tosa-const.mlir
@@ -1,7 +1,7 @@
 // RUN: mlir-opt %s --tosa-arith-const-to-tosa-const --split-input-file | FileCheck %s
 
 // CHECK-LABEL: func.func @rewrite_f32_tensor
-// CHECK: %[[CST:.*]] = "tosa.const"() <{values = dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>}> : () -> tensor<2xf32>
+// CHECK: %[[CST:.*]] = tosa.const values(dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>) : () -> tensor<2xf32>
 // CHECK: return %[[CST]]
 func.func @rewrite_f32_tensor() -> tensor<2xf32> {
   %c = arith.constant dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>
@@ -11,7 +11,7 @@ func.func @rewrite_f32_tensor() -> tensor<2xf32> {
 // -----
 
 // CHECK-LABEL: func.func @rewrite_i32_tensor
-// CHECK: %[[CST:.*]] = "tosa.const"() <{values = dense<[1, 0, -1]> : tensor<3xi32>}> : () -> tensor<3xi32>
+// CHECK: %[[CST:.*]] = tosa.const values(dense<[1, 0, -1]> : tensor<3xi32>) : () -> tensor<3xi32>
 // CHECK: return %[[CST]]
 func.func @rewrite_i32_tensor() -> tensor<3xi32> {
   %c = arith.constant dense<[1, 0, -1]> : tensor<3xi32>
@@ -21,7 +21,7 @@ func.func @rewrite_i32_tensor() -> tensor<3xi32> {
 // -----
 
 // CHECK-LABEL: func.func @rewrite_i1_tensor
-// CHECK: %[[CST:.*]] = "tosa.const"() <{values = dense<[true, false]> : tensor<2xi1>}> : () -> tensor<2xi1>
+// CHECK: %[[CST:.*]] = tosa.const values(dense<[true, false]> : tensor<2xi1>) : () -> tensor<2xi1>
 func.func @rewrite_i1_tensor() -> tensor<2xi1> {
   %c = arith.constant dense<[true, false]> : tensor<2xi1>
   return %c : tensor<2xi1>
@@ -30,7 +30,7 @@ func.func @rewrite_i1_tensor() -> tensor<2xi1> {
 // -----
 
 // CHECK-LABEL: func.func @rewrite_rank0_tensor
-// CHECK: %[[CST:.*]] = "tosa.const"() <{values = dense<1.234500e+00> : tensor<f32>}> : () -> tensor<f32>
+// CHECK: %[[CST:.*]] = tosa.const values(dense<1.234500e+00> : tensor<f32>) : () -> tensor<f32>
 func.func @rewrite_rank0_tensor() -> tensor<f32> {
   %c = arith.constant dense<1.234500e+00> : tensor<f32>
   return %c : tensor<f32>
@@ -57,7 +57,7 @@ func.func @preserve_index_tensor() -> tensor<2xindex> {
 // -----
 
 // CHECK-LABEL: func.func @rewrite_resource_tensor
-// CHECK: %[[CST:.*]] = "tosa.const"() <{values = dense_resource<blob1> : tensor<4xf32>}> : () -> tensor<4xf32>
+// CHECK: %[[CST:.*]] = tosa.const values(dense_resource<blob1> : tensor<4xf32>) : () -> tensor<4xf32>
 func.func @rewrite_resource_tensor() -> tensor<4xf32> {
   %c = arith.constant dense_resource<"blob1"> : tensor<4xf32>
   return %c : tensor<4xf32>
@@ -67,7 +67,7 @@ func.func @rewrite_resource_tensor() -> tensor<4xf32> {
 
 
 // CHECK-LABEL: func.func @rewrite_quant_uniform_tensor
-// CHECK: %[[CST:.*]] = "tosa.const"() <{values = dense<["10", "20"]> : tensor<2x!quant.uniform<i8:f32, 5.000000e-01>>}> : () -> tensor<2x!quant.uniform<i8:f32, 5.000000e-01>>
+// CHECK: %[[CST:.*]] = tosa.const values(dense<["10", "20"]> : tensor<2x!quant.uniform<i8:f32, 5.000000e-01>>) : () -> tensor<2x!quant.uniform<i8:f32, 5.000000e-01>>
 func.func @rewrite_quant_uniform_tensor() -> tensor<2x!quant.uniform<i8:f32, 0.5:0>> {
   %c = arith.constant dense<["10", "20"]> : tensor<2x!quant.uniform<i8:f32, 0.5:0>>
   return %c : tensor<2x!quant.uniform<i8:f32, 0.5:0>>
@@ -76,7 +76,7 @@ func.func @rewrite_quant_uniform_tensor() -> tensor<2x!quant.uniform<i8:f32, 0.5
 // -----
 
 // CHECK-LABEL: func.func @rewrite_fp8_tensor
-// CHECK: %[[CST:.*]] = "tosa.const"() <{values = dense<[1.000000e+00, -5.000000e-01]> : tensor<2xf8E4M3FN>}> : () -> tensor<2xf8E4M3FN>
+// CHECK: %[[CST:.*]] = tosa.const values(dense<[1.000000e+00, -5.000000e-01]> : tensor<2xf8E4M3FN>) : () -> tensor<2xf8E4M3FN>
 func.func @rewrite_fp8_tensor() -> tensor<2xf8E4M3FN> {
   %c = arith.constant dense<[1.0, -0.5]> : tensor<2xf8E4M3FN>
   return %c : tensor<2xf8E4M3FN>
@@ -85,7 +85,7 @@ func.func @rewrite_fp8_tensor() -> tensor<2xf8E4M3FN> {
 // -----
 
 // CHECK-LABEL: func.func @rewrite_mxint8_tensor
-// CHECK: %[[CST:.*]] = "tosa.const"() <{values = dense<["0x00", "0x7F"]> : tensor<2x!tosa.mxint8>}> : () -> tensor<2x!tosa.mxint8>
+// CHECK: %[[CST:.*]] = tosa.const values(dense<["0x00", "0x7F"]> : tensor<2x!tosa.mxint8>) : () -> tensor<2x!tosa.mxint8>
 func.func @rewrite_mxint8_tensor() -> tensor<2x!tosa.mxint8> {
   %c = arith.constant dense<["0x00", "0x7F"]> : tensor<2x!tosa.mxint8>
   return %c : tensor<2x!tosa.mxint8>
diff --git a/mlir/test/Dialect/Tosa/tosa-convert-integer-type-to-signless.mlir b/mlir/test/Dialect/Tosa/tosa-convert-integer-type-to-signless.mlir
index f89bd577dd82e8..e6054aa9e4b9fe 100644
--- a/mlir/test/Dialect/Tosa/tosa-convert-integer-type-to-signless.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-convert-integer-type-to-signless.mlir
@@ -33,8 +33,8 @@ func.func @test_rescale_input_unsigned(%arg0: tensor<1x1xui16>) -> (tensor<1x1xi
 // -----
 
 // CHECK-LABEL: test_rescale_unsigned_zp
-// CHECK: %[[ZP_IN:.*]] = "tosa.const"() <{values = dense<-2> : tensor<1xi8>}> : () -> tensor<1xi8>
-// CHECK: %[[ZP_OUT:.*]] = "tosa.const"() <{values = dense<2> : tensor<1xi8>}> : () -> tensor<1xi8>
+// CHECK: %[[ZP_IN:.*]] = tosa.const values(dense<-2> : tensor<1xi8>) : () -> tensor<1xi8>
+// CHECK: %[[ZP_OUT:.*]] = tosa.const values(dense<2> : tensor<1xi8>) : () -> tensor<1xi8>
 // CHECK: tosa.rescale %arg0, %0, %1, %[[ZP_IN]], %[[ZP_OUT]] scale32(true) rounding_mode<SINGLE_ROUND> per_channel(false) input_unsigned(true) output_unsigned(false) : (tensor<1x1xi8>, tensor<1xi32>, tensor<1xi8>, tensor<1xi8>, tensor<1xi8>)
 func.func @test_rescale_unsigned_zp(%arg0: tensor<1x1xui8>) -> tensor<1x1xi8> {
   %0 = "tosa.const"() <{values = dense<2> : tensor<1xi32>}> : () -> tensor<1xi32>
@@ -57,7 +57,7 @@ func.func @test_unsigned_function_signature(%arg0: tensor<1xui8>, %arg1: tensor<
 // -----
 
 // CHECK-LABEL: test_unsigned_const_data
-// CHECK: "tosa.const"() <{values = dense<[-1, -2, 0, 1, -128]> : tensor<5xi8>}> : () -> tensor<5xi8>
+// CHECK: tosa.const values(dense<[-1, -2, 0, 1, -128]> : tensor<5xi8>) : () -> tensor<5xi8>
 func.func @test_unsigned_const_data() -> tensor<5xui8> {
   %0 = "tosa.const"() <{values = dense<[255, 254, 0, 1, 128]> : tensor<5xui8>}> : () -> tensor<5xui8>
   return %0 : tensor<5xui8>
@@ -66,7 +66,7 @@ func.func @test_unsigned_const_data() -> tensor<5xui8> {
 // -----
 
 // CHECK-LABEL: test_unsigned_const_data_i16
-// CHECK: "tosa.const"() <{values = dense<[-1, -2, 0, 1, -32768]> : tensor<5xi16>}> : () -> tensor<5xi16>
+// CHECK: tosa.const values(dense<[-1, -2, 0, 1, -32768]> : tensor<5xi16>) : () -> tensor<5xi16>
 func.func @test_unsigned_const_data_i16() -> tensor<5xui16> {
   %0 = "tosa.const"() <{values = dense<[65535, 65534, 0, 1, 32768]> : tensor<5xui16>}> : () -> tensor<5xui16>
   return %0 : tensor<5xui16>
@@ -75,7 +75,7 @@ func.func @test_unsigned_const_data_i16() -> tensor<5xui16> {
 // -----
 
 // CHECK-LABEL: test_unsigned_const_data_i32
-// CHECK: "tosa.const"() <{values = dense<[-1, -2, 0, 1, -2147483648]> : tensor<5xi32>}> : () -> tensor<5xi32>
+// CHECK: tosa.const values(dense<[-1, -2, 0, 1, -2147483648]> : tensor<5xi32>) : () -> tensor<5xi32>
 func.func @test_unsigned_const_data_i32() -> tensor<5xui32> {
   %0 = "tosa.const"() <{values = dense<[4294967295, 4294967294, 0, 1, 2147483648]> : tensor<5xui32>}> : () -> tensor<5xui32>
   return %0 : tensor<5xui32>
@@ -84,7 +84,7 @@ func.func @test_unsigned_const_data_i32() -> tensor<5xui32> {
 // -----
 
 // CHECK-LABEL: test_unsigned_const_data_i48
-// CHECK: "tosa.const"() <{values = dense<[-1, -2, 0, 1, -140737488355328]> : tensor<5xi48>}> : () -> tensor<5xi48>
+// CHECK: tosa.const values(dense<[-1, -2, 0, 1, -140737488355328]> : tensor<5xi48>) : () -> tensor<5xi48>
 func.func @test_unsigned_const_data_i48() -> tensor<5xui48> {
   %0 = "tosa.const"() <{values = dense<[281474976710655, 281474976710654, 0, 1, 140737488355328]> : tensor<5xui48>}> : () -> tensor<5xui48>
   return %0 : tensor<5xui48>
diff --git a/mlir/test/Dialect/Tosa/tosa-decompose-depthwise.mlir b/mlir/test/Dialect/Tosa/tosa-decompose-depthwise.mlir
index 941e23061611ff..d11b0f394551e1 100644
--- a/mlir/test/Dialect/Tosa/tosa-decompose-depthwise.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-decompose-depthwise.mlir
@@ -106,7 +106,7 @@ func.func @depthwise_conv2d_no_const_zero_point(%arg0: tensor<4x10x10x2xi8>, %ar
 // CHECK-SAME:      %[[BIAS:.*]]: tensor<?xf32>) -> tensor<?x10x10x6xf32> {
 // CHECK:           %[[BIAS_EXPANDED_SHAPE:.*]] = tosa.const_shape values(dense<[1, 1, 1, -1]> : tensor<4xindex>) : () -> !tosa.shape<4>
 // CHECK:           %[[RES_EXPANDED_SHAPE:.*]] = tosa.const_shape values(dense<[-1, 10, 10, 6]> : tensor<4xindex>) : () -> !tosa.shape<4>
-// CHECK:           %[[MUL_SHIFT:.*]] = "tosa.const"() <{values = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
+// CHECK:           %[[MUL_SHIFT:.*]] = tosa.const values(dense<0> : tensor<1xi8>) : () -> tensor<1xi8>
 // CHECK:           %[[WTS_EXPANDED_SHAPE:.*]] = tosa.const_shape values(dense<[1, 1, 1, 2, 3]> : tensor<5xindex>) : () -> !tosa.shape<5>
 // CHECK:           %[[INP_EXPANDED_SHAPE:.*]] = tosa.const_shape values(dense<[-1, 10, 10, 2, 1]> : tensor<5xindex>) : () -> !tosa.shape<5>
 // CHECK:           %[[INP_RESHAPED:.*]] = tosa.reshape %[[INP]], %[[INP_EXPANDED_SHAPE]] : (tensor<?x10x10x2xf32>, !tosa.shape<5>) -> tensor<?x10x10x2x1xf32>
diff --git a/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir b/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
index 3cd1b964a8a1c4..38488160d8a458 100644
--- a/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
@@ -100,10 +100,10 @@ func.func @test_unary_i32(%arg0 : tensor<4xi32>, %arg1 : tensor<2xi8>) -> () {
   // CHECK: tosa.reverse %arg0 axis(0) : (tensor<4xi32>) -> tensor<4xi32>
   %5 = tosa.reverse %arg0 axis(0) : (tensor<4xi32>) -> tensor<?xi32>
 
-  // CHECK-DAG: %[[MULT:.+]] = "tosa.const"() <{values = dense<[42, 43]> : tensor<2xi16>}> : () -> tensor<2xi16>
-  // CHECK-DAG: %[[SHIFT:.+]] = "tosa.const"() <{values = dense<[14, 15]> : tensor<2xi8>}> : () -> tensor<2xi8>
-  // CHECK-DAG: %[[INPUTZP:.+]] = "tosa.const"() <{values = dense<43> : tensor<1xi8>}> : () -> tensor<1xi8>
-  // CHECK-DAG: %[[OUTPUTZP:.+]] = "tosa.const"() <{values = dense<52> : tensor<1xi8>}> : () -> tensor<1xi8>
+  // CHECK-DAG: %[[MULT:.+]] = tosa.const values(dense<[42, 43]> : tensor<2xi16>) : () -> tensor<2xi16>
+  // CHECK-DAG: %[[SHIFT:.+]] = tosa.const values(dense<[14, 15]> : tensor<2xi8>) : () -> tensor<2xi8>
+  // CHECK-DAG: %[[INPUTZP:.+]] = tosa.const values(dense<43> : tensor<1xi8>) : () -> tensor<1xi8>
+  // CHECK-DAG: %[[OUTPUTZP:.+]] = tosa.const values(dense<52> : tensor<1xi8>) : () -> tensor<1xi8>
   // CHECK: tosa.rescale %arg1, %[[MULT]], %[[SHIFT]], %[[INPUTZP]], %[[OUTPUTZP]] {{.+}} : (tensor<2xi8>, tensor<2xi16>, tensor<2xi8>, tensor<1xi8>, tensor<1xi8>) -> tensor<2xi8>
   %multiplier = "tosa.const"() <{values = dense<[42, 43]> : tensor<2xi16>}> : () -> tensor<2xi16>
   %shift = "tosa.const"() <{values = dense<[14, 15]> : tensor<2xi8>}> : () -> tensor<2xi8>
@@ -1892,7 +1892,7 @@ func.func @test_multiple_non_inferrable_consumers(%arg0: tensor<1x2x8xf32>) {
 // -----
 // CHECK-LABEL: test_mul_scalar
 func.func @test_mul_scalar(%arg0: tensor<f32>, %arg1: tensor<f32>) -> tensor<*xf32> {
-  // CHECK: %[[SHIFT:.*]] = "tosa.const"() <{values = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
+  // CHECK: %[[SHIFT:.*]] = tosa.const values(dense<0> : tensor<1xi8>) : () -> tensor<1xi8>
   // CHECK: tosa.mul %arg0, %arg1, %[[SHIFT]] : (tensor<f32>, tensor<f32>, tensor<1xi8>) -> tensor<f32>
   %shift = "tosa.const"() <{values = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
   %0 = tosa.mul %arg0, %arg1, %shift : (tensor<f32>, tensor<f32>, tensor<1xi8>) -> tensor<*xf32>
diff --git a/mlir/test/Dialect/Tosa/tosa-layerwise-constant-fold.mlir b/mlir/test/Dialect/Tosa/tosa-layerwise-constant-fold.mlir
index 4603c68bf21f25..e5eeff864a5b68 100644
--- a/mlir/test/Dialect/Tosa/tosa-layerwise-constant-fold.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-layerwise-constant-fold.mlir
@@ -541,7 +541,7 @@ func.func @reduce_any_constant() -> tensor<1x3xi1> {
 
 func.func @reduce_any_constant() -> tensor<2x1xi1> {
 // CHECK-LABEL:   func.func @reduce_any_constant() -> tensor<2x1xi1> {
-// CHECK:           %[[VAL_0:.*]] = "tosa.const"() <{values = dense<true> : tensor<2x1xi1>}> : () -> tensor<2x1xi1>
+// CHECK:           %[[VAL_0:.*]] = tosa.const values(dense<true> : tensor<2x1xi1>) : () -> tensor<2x1xi1>
 // CHECK:           return %[[VAL_0]] : tensor<2x1xi1>
 // CHECK:         }
 
@@ -626,7 +626,7 @@ func.func @reduce_all_constant() -> tensor<2x1x4xi1> {
 
 func.func @reduce_sum_constant() -> tensor<1x3xi32> {
 // CHECK-LABEL:   func.func @reduce_sum_constant() -> tensor<1x3xi32> {
-// CHECK:           %[[VAL_0:.*]] = "tosa.const"() <{values = dense<2> : tensor<1x3xi32>}> : () -> tensor<1x3xi32>
+// CHECK:           %[[VAL_0:.*]] = tosa.const values(dense<2> : tensor<1x3xi32>) : () -> tensor<1x3xi32>
 // CHECK:           return %[[VAL_0]] : tensor<1x3xi32>
 // CHECK:         }
   %const = "tosa.const"() <{values = dense<1> : tensor<2x3xi32>}> : () -> tensor<2x3xi32>
diff --git a/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32-aggressive.mlir b/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32-aggressive.mlir
index 03f4e72f78009f..f9f0dfaed90935 100644
--- a/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32-aggressive.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32-aggressive.mlir
@@ -61,7 +61,7 @@ func.func @test_convert_input_parameters(%arg0: tensor<1x3xf64>) -> tensor<1x3xf
 
 // CHECK-LABEL: test_f64_const
 func.func @test_f64_const() -> tensor<2xf64> {
-  // COMMON: %[[CONST:.*]] = "tosa.const"() <{values = dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>}> : () -> tensor<2xf32>
+  // COMMON: %[[CONST:.*]] = tosa.const values(dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>) : () -> tensor<2xf32>
   %0 = "tosa.const"() <{values = dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf64>}> : () -> tensor<2xf64>
   // DEFAULT: %[[OUT:.*]] = tosa.cast %[[CONST]] input_unsigned(false) : (tensor<2xf32>) -> tensor<2xf64>
   // DEFAULT: return %[[OUT]] : tensor<2xf64>
@@ -73,7 +73,7 @@ func.func @test_f64_const() -> tensor<2xf64> {
 
 // CHECK-LABEL: test_dense_ressource_f64
 func.func @test_dense_ressource_f64() -> tensor<1x2xf64> {
-  // COMMON: %[[CONST:.*]] = "tosa.const"() <{values = dense_resource<resource> : tensor<1x2xf32>}> : () -> tensor<1x2xf32>
+  // COMMON: %[[CONST:.*]] = tosa.const values(dense_resource<resource> : tensor<1x2xf32>) : () -> tensor<1x2xf32>
   %0 = "tosa.const"() <{values = dense_resource<resource> : tensor<1x2xf64>}> : () -> tensor<1x2xf64>
   // DEFAULT: %[[OUT_CAST:.*]] = tosa.cast %[[CONST]] input_unsigned(false) : (tensor<1x2xf32>) -> tensor<1x2xf64>
   // DEFAULT: return %[[OUT_CAST]] : tensor<1x2xf64>
diff --git a/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32.mlir b/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32.mlir
index 9eda0d85d0fddc..a5fdcf64da477c 100644
--- a/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32.mlir
@@ -21,7 +21,7 @@ func.func @test_f64_identity_chain(%arg0: tensor<1xf64>) -> tensor<1xf64> {
 
 // CHECK-LABEL: test_f64_const
 func.func @test_f64_const() -> tensor<2xf64> {
-  // COMMON: %[[CONST:.*]] = "tosa.const"() <{values = dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>}> : () -> tensor<2xf32>
+  // COMMON: %[[CONST:.*]] = tosa.const values(dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf32>) : () -> tensor<2xf32>
   %0 = "tosa.const"() <{values = dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf64>}> : () -> tensor<2xf64>
   // DEFAULT: %[[OUT:.*]] = tosa.cast %[[CONST]] input_unsigned(false) : (tensor<2xf32>) -> tensor<2xf64>
   // DEFAULT: return %[[OUT]] : tensor<2xf64>
@@ -183,7 +183,7 @@ func.func @test_f64_add_diagnostic(%arg0: tensor<13x21x1xf64>, %arg1: tensor<13x
 
 // CHECK-LABEL: test_dense_ressource_f64
 func.func @test_dense_ressource_f64() -> tensor<1x2xf64> {
-  // COMMON: %[[CONST:.*]] = "tosa.const"() <{values = dense_resource<resource> : tensor<1x2xf32>}> : () -> tensor<1x2xf32>
+  // COMMON: %[[CONST:.*]] = tosa.const values(dense_resource<resource> : tensor<1x2xf32>) : () -> tensor<1x2xf32>
   %0 = "tosa.const"() <{values = dense_resource<resource> : tensor<1x2xf64>}> : () -> tensor<1x2xf64>
   // DEFAULT: %[[OUT_CAST:.*]] = tosa.cast %[[CONST]] input_unsigned(false) : (tensor<1x2xf32>) -> tensor<1x2xf64>
   // DEFAULT: return %[[OUT_CAST]] : tensor<1x2xf64>
diff --git a/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32-aggressive.mlir b/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32-aggressive.mlir
index fb1ac576484fc2..b7a7f0543d911c 100644
--- a/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32-aggressive.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32-aggressive.mlir
@@ -72,7 +72,7 @@ func.func @test_regions(%arg0: tensor<i64>, %arg1: tensor<i64>, %arg2: tensor<i1
 
 // CHECK-LABEL: test_const
 func.func @test_const() -> tensor<2xi64> {
-  // COMMON: %[[CONST:.*]] = "tosa.const"() <{values = dense<[1, 2]> : tensor<2xi32>}> : () -> tensor<2xi32>
+  // COMMON: %[[CONST:.*]] = tosa.const values(dense<[1, 2]> : tensor<2xi32>) : () -> tensor<2xi32>
   %0 = "tosa.const"() <{values = dense<[1, 2]> : tensor<2xi64>}> : () -> tensor<2xi64>
   // DEFAULT: %[[OUT:.*]] = tosa.cast %[[CONST]] input_unsigned(false) : (tensor<2xi32>) -> tensor<2xi64>
   // DEFAULT: return %[[OUT]] : tensor<2xi64>
@@ -93,7 +93,7 @@ func.func @test_clamp_trunc(%arg0: tensor<100xi64>) -> tensor<100xi64> {
 
 // CHECK-LABEL: test_dense_ressource_i64
 func.func @test_dense_ressource_i64() -> tensor<1x2xi64> {
-  // COMMON: %[[CONST:.*]] = "tosa.const"() <{values = dense_resource<resource> : tensor<1x2xi32>}> : () -> tensor<1x2xi32>
+  // COMMON: %[[CONST:.*]] = tosa.const values(dense_resource<resource> : tensor<1x2xi32>) : () -> tensor<1x2xi32>
   %1 = "tosa.const"() <{values = dense_resource<resource> : tensor<1x2xi64>}> : () -> tensor<1x2xi64>
   // DEFAULT: %[[OUT_CAST:.*]] = tosa.cast %[[CONST]] input_unsigned(false) : (tensor<1x2xi32>) -> tensor<1x2xi64>
   // DEFAULT: return %[[OUT_CAST]] : tensor<1x2xi64>
diff --git a/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32.mlir b/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32.mlir
index cbe4232376c62a..415728fcb8792a 100644
--- a/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32.mlir
@@ -17,7 +17,7 @@ func.func @test_i64_argmax(%arg0: tensor<1x513x513x19xi8>) -> tensor<1x513x513xi
 
 // CHECK-LABEL: test_i64_const
 func.func @test_i64_const() -> tensor<2xi64> {
-  // COMMON: %[[CONST:.*]] = "tosa.const"() <{values = dense<[1, 2]> : tensor<2xi32>}> : () -> tensor<2xi32>
+  // COMMON: %[[CONST:.*]] = tosa.const values(dense<[1, 2]> : tensor<2xi32>) : () -> tensor<2xi32>
   %0 = "tosa.const"() <{values = dense<[1, 2]> : tensor<2xi64>}> : () -> tensor<2xi64>
   // DEFAULT: %[[OUT:.*]] = tosa.cast %[[CONST]] input_unsigned(false) : (tensor<2xi32>) -> tensor<2xi64>
   // DEFAULT: return %[[OUT]] : tensor<2xi64>
@@ -239,7 +239,7 @@ func.func @test_clamp_min_outside_i32_range(%arg0: tensor<100xi64>) -> tensor<10
 
 // CHECK-LABEL: test_dense_ressource_i64
 func.func @test_dense_ressource_i64() -> tensor<1x2xi64> {
-  // COMMON: %[[CONST:.*]] = "tosa.const"() <{values = dense_resource<resource> : tensor<1x2xi32>}> : () -> tensor<1x2xi32>
+  // COMMON: %[[CONST:.*]] = tosa.const values(dense_resource<resource> : tensor<1x2xi32>) : () -> tensor<1x2xi32>
   %1 = "tosa.const"() <{values = dense_resource<resource> : tensor<1x2xi64>}> : () -> tensor<1x2xi64>
   // DEFAULT: %[[OUT_CAST:.*]] = tosa.cast %[[CONST]] input_unsigned(false) : (tensor<1x2xi32>) -> tensor<1x2xi64>
   // DEFAULT: return %[[OUT_CAST]] : tensor<1x2xi64>
diff --git a/mlir/test/Dialect/Tosa/tosa-reduce-transposes.mlir b/mlir/test/Dialect/Tosa/tosa-reduce-transposes.mlir
index b0abd5bdf14241..ab9abcf7ec2ecc 100644
--- a/mlir/test/Dialect/Tosa/tosa-reduce-transposes.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-reduce-transposes.mlir
@@ -114,7 +114,7 @@ func.func @test_torch_conv2d_with_elementwise_in_between(%arg0: tensor<3x3x10x10
 // -----
 
 // CHECK-LABEL: @test_mulop_conversion
-// CHECK-NEXT: %[[SHIFT:.*]] = "tosa.const"() <{values = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
+// CHECK-NEXT: %[[SHIFT:.*]] = tosa.const values(dense<0> : tensor<1xi8>) : () -> tensor<1xi8>
 // CHECK-NEXT: %[[RES:.*]] = tosa.mul %arg0, %arg1, %[[SHIFT]]
 // CHECK-NEXT: return %[[RES]]
 func.func @test_mulop_conversion(%arg0: tensor<1x2x3x4xi32>, %arg1: tensor<1x2x3x4xi32>) -> tensor<1x2x3x4xi32> {
@@ -157,7 +157,7 @@ func.func @test_dynamic_broadcasting_reshape(%arg0: tensor<?xi32>) -> tensor<1x1
 // -----
 
 // CHECK-LABEL: @test_reshape_for_broadcast
-// CHECK-DAG: %[[RESHAPE_INPUT:.*]] = "tosa.const"() <{values = dense<[1, 2, 3, 4]>
+// CHECK-DAG: %[[RESHAPE_INPUT:.*]] = tosa.const values(dense<[1, 2, 3, 4]>
 // CHECK-DAG: %[[SHAPE:.*]] = tosa.const_shape values(dense<[4, 1, 1]> : tensor<3xindex>)
 // CHECK: %[[RESHAPE:.*]] = tosa.reshape %[[RESHAPE_INPUT]], %[[SHAPE]] : (tensor<4xi32>, !tosa.shape<3>) -> tensor<4x1x1xi32>
 // CHECK: %[[ADD:.*]] = tosa.add %arg0, %[[RESHAPE]]
@@ -195,11 +195,11 @@ func.func @test_multi_dim_reshape_for_broadcast(%arg0: tensor<1x4x1xi32>, %arg1:
 
 // CHECK-LABEL: @test_resnet18_common_case
 // COM: note that %74 is now represented by %arg2
-// CHECK-DAG: %[[CONST0:.+]] = "tosa.const"() <{values = dense<0> : tensor<1xi8>}> : () -> tensor<1xi8>
-// CHECK-DAG: %[[VAL_3:.*]] = "tosa.const"() <{values = dense_resource<torch_tensor_64_torch.float32_1> : tensor<64xf32>}> : () -> tensor<64xf32>
-// CHECK-DAG: %[[VAL_4:.*]] = "tosa.const"() <{values = dense_resource<torch_tensor_64_torch.float32> : tensor<64xf32>}> : () -> tensor<64xf32>
-// CHECK-DAG: %[[VAL_5:.*]] = "tosa.const"() <{values = dense<9.99999974E-6> : tensor<1xf32>}> : () -> tensor<1xf32>
-// CHECK-DAG: %[[VAL_6:.*]] = "tosa.const"() <{values = dense<5.000000e-01> : tensor<1xf32>}> : () -> tensor<1xf32>
+// CHECK-DAG: %[[CONST0:.+]] = tosa.const values(dense<0> : tensor<1xi8>) : () -> tensor<1xi8>
+// CHECK-DAG: %[[VAL_3:.*]] = tosa.const values(dense_resource<torch_tensor_64_torch.float32_1> : tensor<64xf32>) : () -> tensor<64xf32>
+// CHECK-DAG: %[[VAL_4:.*]] = tosa.const values(dense_resource<torch_tensor_64_torch.float32> : tensor<64xf32>) : () -> tensor<64xf32>
+// CHECK-DAG: %[[VAL_5:.*]] = tosa.const values(dense<9.99999974E-6> : tensor<1xf32>) : () -> tensor<1xf32>
+// CHECK-DAG: %[[VAL_6:.*]] = tosa.const values(dense<5.000000e-01> : tensor<1xf32>) : () -> tensor<1xf32>
 // CHECK-DAG: %[[VAL_7:.*]] = tosa.add %arg1, %[[VAL_5]] : (tensor<64xf32>, tensor<1xf32>) -> tensor<64xf32>
 // CHECK-DAG: %[[VAL_8:.*]] = tosa.pow %[[VAL_7]], %[[VAL_6]] : (tensor<64xf32>, tensor<1xf32>) -> tensor<64xf32>
 // CHECK-DAG: %[[VAL_9:.*]] = tosa.reciprocal %[[VAL_8]] : (tensor<64xf32>) -> tensor<64xf32>
@@ -383,7 +383,7 @@ func.func @test_direct_use_in_other_transpose_with_same_perms(%arg0: tensor<3x3x
 // -----
 
 // CHECK-LABEL: @test_const_transpose
-// CHECK: %[[NEW:.*]] = "tosa.const"() <{values = dense<0> : tensor<2x3xi32>}> : () -> tensor<2x3xi32>
+// CHECK: %[[NEW:.*]] = tosa.const values(dense<0> : tensor<2x3xi32>) : () -> tensor<2x3xi32>
 // CHECK-NOT: tosa.transpose
 // CHECK: return %[[NEW]]
 func.func @test_const_transpose() -> tensor<2x3xi32> {
@@ -395,7 +395,7 @@ func.func @test_const_transpose() -> tensor<2x3xi32> {
 // -----
 
 // CHECK-LABEL: @test_transpose_tracks_to_const_single_step
-// CHECK: %[[NEW_CONST:.*]] = "tosa.const"() <{values = dense<0> : tensor<1x2x3x4xi32>}> : () -> tensor<1x2x3x4xi32>
+// CHECK: %[[NEW_CONST:.*]] = tosa.const values(dense<0> : tensor<1x2x3x4xi32>) : () -> tensor<1x2x3x4xi32>
 // CHECK: %[[NEW_CLAMP:.*]] = tosa.clamp %[[NEW_CONST]] min_val(0 : i32) max_val(2147483647 : i32) : (tensor<1x2x3x4xi32>) -> tensor<1x2x3x4xi32>
 // CHECK-NOT: tosa.transpose
 // CHECK: return %[[NEW_CLAMP]]
@@ -409,7 +409,7 @@ func.func @test_transpose_tracks_to_const_single_step() -> tensor<1x2x3x4xi32> {
 // -----
 
 // CHECK-LABEL: @test_static_unary_path_to_const
-// CHECK: %[[NEW_CONST:.*]] = "tosa.const"() <{values = dense<1> : tensor<1x2x3x4xi32>}> : () -> tensor<1x2x3x4xi32>
+// CHECK: %[[NEW_CONST:.*]] = tosa.const values(dense<1> : tensor<1x2x3x4xi32>) : () -> tensor<1x2x3x4xi32>
 // CHECK: %[[NEW_CLAMP:.*]] = tosa.clamp %[[NEW_CONST]] min_val(0 : i32) max_val(2147483647 : i32) : (tensor<1x2x3x4xi32>) -> tensor<1x2x3x4xi32>
 // CHECK: %[[NEW_ABS:.*]] = tosa.abs %[[NEW_CLAMP]] : (tensor<1x2x3x4xi32>) -> tensor<1x2x3x4xi32>
 // CHECK: %[[NEW_NOT:.*]] = tosa.bitwise_not %[[NEW_ABS]] : (tensor<1x2x3x4xi32>) -> tensor<1x2x3x4xi32>
@@ -614,4 +614,4 @@ func.func @test_transpose_i4() -> tensor<3x2xi4> {
   %0 = "tosa.const"() <{values = dense<[[1, 2, 3], [4, 5, 6]]> : tensor<2x3xi4>}> : () -> tensor<2x3xi4>
   %1 = tosa.transpose %0 perms([1, 0]) : (tensor<2x3xi4>) -> tensor<3x2xi4>
   return %1 : tensor<3x2xi4>
-}
\ No newline at end of file
+}



More information about the Mlir-commits mailing list