[Mlir-commits] [mlir] [mlir][tosa] Use 0 values for the dense resource in tosa-narrow-* tests (PR #182321)

Thibaut Goetghebuer-Planchon llvmlistbot at llvm.org
Thu Feb 19 09:18:13 PST 2026


https://github.com/Tessil created https://github.com/llvm/llvm-project/pull/182321

For the test portability between little-endian and big-endian, just use zeros as the dense resource values. It doesn't test the actual narrowing but tests that the other conversions went well.

>From 012342171af6df5bb9aefee9e83176ebcbf0d4c0 Mon Sep 17 00:00:00 2001
From: Thibaut Goetghebuer-Planchon <thibaut.goetghebuer-planchon at arm.com>
Date: Thu, 19 Feb 2026 17:13:34 +0000
Subject: [PATCH] [mlir][tosa] Use 0 values for the dense resource in
 tosa-narrow-* tests

For the test portability between little-endian and big-endian, just use zeros as the dense resource values.
It doesn't test the actual narrowing but tests that the other conversions went well.
---
 mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32-aggressive.mlir | 4 ++--
 mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32.mlir            | 4 ++--
 mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32-aggressive.mlir | 4 ++--
 mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32.mlir            | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

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 fe2145060ebb8..2f02e3e9e7609 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
@@ -83,8 +83,8 @@ func.func @test_dense_ressource_f64() -> tensor<1x2xf64> {
 {-#
   dialect_resources: {
     builtin: {
-      // COMMON: resource: "0x04000000DB0F4940EAD6FCBD"
-      resource: "0x08000000182D4454FB21094059F64637DD9ABFBF"
+      // COMMON: resource: "0x040000000000000000000000"
+      resource: "0x0800000000000000000000000000000000000000"
     }
   }
 #-}
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 f143a91149847..58f4bdc390deb 100644
--- a/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-narrow-f64-to-f32.mlir
@@ -193,8 +193,8 @@ func.func @test_dense_ressource_f64() -> tensor<1x2xf64> {
 {-#
   dialect_resources: {
     builtin: {
-      // COMMON: resource: "0x040000000000803F000080BF"
-      resource: "0x08000000000000000000F03F000000000000F0BF"
+      // COMMON: resource: "0x040000000000000000000000"
+      resource: "0x0800000000000000000000000000000000000000"
     }
   }
 #-}
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 d80c16b109207..b7d0a025a04e7 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
@@ -103,8 +103,8 @@ func.func @test_dense_ressource_i64() -> tensor<1x2xi64> {
 {-#
   dialect_resources: {
     builtin: {
-      // COMMON: resource: "0x04000000FFFFFF7F00000080"
-      resource: "0x08000000000000000800000000000000F8FFFFFF"
+      // COMMON: resource: "0x040000000000000000000000"
+      resource: "0x0800000000000000000000000000000000000000"
     }
   }
 #-}
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 b15dc4c3d11ad..4eb8e63783aa2 100644
--- a/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-narrow-i64-to-i32.mlir
@@ -214,8 +214,8 @@ func.func @test_dense_ressource_i64() -> tensor<1x2xi64> {
 {-#
   dialect_resources: {
     builtin: {
-      // COMMON: resource: "0x04000000FEFFFF7F905AE75A"
-      resource: "0x08000000FEFFFF7F00000000905AE75A00000000"
+      // COMMON: resource: "0x040000000000000000000000"
+      resource: "0x0800000000000000000000000000000000000000"
     }
   }
 #-}



More information about the Mlir-commits mailing list