[Mlir-commits] [mlir] [mlir][arith] mul operation regressions (PR #96975)

Jacob Yu llvmlistbot at llvm.org
Sat Jul 6 07:07:07 PDT 2024


https://github.com/pingshiyu updated https://github.com/llvm/llvm-project/pull/96975

>From 67998205165c1e733084431ad48ab283dc0e172b Mon Sep 17 00:00:00 2001
From: pingshiyu <pingshiyu at gmail.com>
Date: Thu, 27 Jun 2024 22:58:35 +0100
Subject: [PATCH 1/7] mul regressions

---
 .../Dialect/Arith/CPU/multiplication.mlir     | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir

diff --git a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
new file mode 100644
index 00000000000000..494bc2af1821e1
--- /dev/null
+++ b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
@@ -0,0 +1,44 @@
+// Tests mul operations and their variants (e.g. extended).
+// These tests are intended to be target agnostic: they should yield the same results 
+// regardless of the target platform.
+
+// RUN: mlir-opt %s --convert-scf-to-cf --convert-cf-to-llvm --convert-vector-to-llvm \
+// RUN:             --convert-func-to-llvm --convert-arith-to-llvm | \
+// RUN:   mlir-cpu-runner -e entry -entry-point-result=void \
+// RUN:                   --shared-libs=%mlir_c_runner_utils | \
+// RUN:   FileCheck %s --match-full-lines
+
+func.func @mulsi_extended_on_i1() {
+    // mulsi_extended on i1, tests for overflow bit
+    // mulsi_extended 1, 1 : i1 = (1, 0)
+    // CHECK:      1
+    // CHECK-NEXT: 0
+    %true = arith.constant true
+    %low, %high = arith.mulsi_extended %true, %true : i1
+    vector.print %low : i1
+    vector.print %high : i1
+    return
+}
+
+func.func @mulsi_mului_extended_overflows() {
+    // mulsi and mului extended versions, with overflow
+    // mulsi_extended -100, -100 : i8 = (16, 39); mului_extended -100, -100 : i8 = (16, 95)
+    // CHECK-NEXT:  16
+    // CHECK-NEXT:  39
+    // CHECK-NEXT:  16
+    // CHECK-NEXT:  95
+    %c-100_i8 = arith.constant -100 : i8
+    %low, %high = arith.mulsi_extended %c-100_i8, %c-100_i8 : i8
+    vector.print %low : i8
+    vector.print %high : i8
+    %low_0, %high_1 = arith.mului_extended %c-100_i8, %c-100_i8 : i8
+    vector.print %low_0 : i8
+    vector.print %high_1 : i8
+    return
+}
+
+func.func @entry() {
+    func.call @mulsi_extended_on_i1() : () -> ()
+    func.call @mulsi_mului_extended_overflows() : () -> ()
+    return
+}

>From 3edd5f75273ae4fa347fba49dcf1629e74c1e281 Mon Sep 17 00:00:00 2001
From: pingshiyu <pingshiyu at gmail.com>
Date: Fri, 28 Jun 2024 12:27:40 +0100
Subject: [PATCH 2/7] reindented

---
 .../Dialect/Arith/CPU/multiplication.mlir     | 52 +++++++++----------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
index 494bc2af1821e1..c48173db81f92e 100644
--- a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
+++ b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
@@ -9,36 +9,36 @@
 // RUN:   FileCheck %s --match-full-lines
 
 func.func @mulsi_extended_on_i1() {
-    // mulsi_extended on i1, tests for overflow bit
-    // mulsi_extended 1, 1 : i1 = (1, 0)
-    // CHECK:      1
-    // CHECK-NEXT: 0
-    %true = arith.constant true
-    %low, %high = arith.mulsi_extended %true, %true : i1
-    vector.print %low : i1
-    vector.print %high : i1
-    return
+  // mulsi_extended on i1, tests for overflow bit
+  // mulsi_extended 1, 1 : i1 = (1, 0)
+  // CHECK:      1
+  // CHECK-NEXT: 0
+  %true = arith.constant true
+  %low, %high = arith.mulsi_extended %true, %true : i1
+  vector.print %low : i1
+  vector.print %high : i1
+  return
 }
 
 func.func @mulsi_mului_extended_overflows() {
-    // mulsi and mului extended versions, with overflow
-    // mulsi_extended -100, -100 : i8 = (16, 39); mului_extended -100, -100 : i8 = (16, 95)
-    // CHECK-NEXT:  16
-    // CHECK-NEXT:  39
-    // CHECK-NEXT:  16
-    // CHECK-NEXT:  95
-    %c-100_i8 = arith.constant -100 : i8
-    %low, %high = arith.mulsi_extended %c-100_i8, %c-100_i8 : i8
-    vector.print %low : i8
-    vector.print %high : i8
-    %low_0, %high_1 = arith.mului_extended %c-100_i8, %c-100_i8 : i8
-    vector.print %low_0 : i8
-    vector.print %high_1 : i8
-    return
+  // mulsi and mului extended versions, with overflow
+  // mulsi_extended -100, -100 : i8 = (16, 39); mului_extended -100, -100 : i8 = (16, 95)
+  // CHECK-NEXT:  16
+  // CHECK-NEXT:  39
+  // CHECK-NEXT:  16
+  // CHECK-NEXT:  95
+  %c-100_i8 = arith.constant -100 : i8
+  %low, %high = arith.mulsi_extended %c-100_i8, %c-100_i8 : i8
+  vector.print %low : i8
+  vector.print %high : i8
+  %low_0, %high_1 = arith.mului_extended %c-100_i8, %c-100_i8 : i8
+  vector.print %low_0 : i8
+  vector.print %high_1 : i8
+  return
 }
 
 func.func @entry() {
-    func.call @mulsi_extended_on_i1() : () -> ()
-    func.call @mulsi_mului_extended_overflows() : () -> ()
-    return
+  func.call @mulsi_extended_on_i1() : () -> ()
+  func.call @mulsi_mului_extended_overflows() : () -> ()
+  return
 }

>From 041601a008c830f8631d9ec83d79a9e17ad3db69 Mon Sep 17 00:00:00 2001
From: pingshiyu <pingshiyu at gmail.com>
Date: Sat, 29 Jun 2024 21:08:01 +0100
Subject: [PATCH 3/7] multiplication tests refactored

---
 .../Dialect/Arith/CPU/multiplication.mlir     | 69 +++++++++++++++----
 1 file changed, 54 insertions(+), 15 deletions(-)

diff --git a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
index c48173db81f92e..8514b8018683bb 100644
--- a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
+++ b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
@@ -8,37 +8,76 @@
 // RUN:                   --shared-libs=%mlir_c_runner_utils | \
 // RUN:   FileCheck %s --match-full-lines
 
+func.func @mulsi_extended_i1(%v1 : i1, %v2 : i1) -> (i1, i1) {
+  %low, %high = arith.mulsi_extended %v1, %v2 : i1
+  vector.print %low : i1
+  vector.print %high : i1
+  func.return %low, %high : i1, i1
+}
+
 func.func @mulsi_extended_on_i1() {
   // mulsi_extended on i1, tests for overflow bit
   // mulsi_extended 1, 1 : i1 = (1, 0)
+  %true = arith.constant true
+  %false = arith.constant false
+
   // CHECK:      1
   // CHECK-NEXT: 0
-  %true = arith.constant true
-  %low, %high = arith.mulsi_extended %true, %true : i1
-  vector.print %low : i1
-  vector.print %high : i1
+  func.call @mulsi_extended_i1(%true, %true) : (i1, i1) -> (i1, i1)
+
+  // CHECK-NEXT: 0
+  // CHECK-NEXT: 0
+  func.call @mulsi_extended_i1(%true, %false) : (i1, i1) -> (i1, i1)
+
+  // CHECK-NEXT: 0
+  // CHECK-NEXT: 0
+  func.call @mulsi_extended_i1(%false, %true) : (i1, i1) -> (i1, i1)
+
+  // CHECK-NEXT: 0
+  // CHECK-NEXT: 0
+  func.call @mulsi_extended_i1(%false, %false) : (i1, i1) -> (i1, i1)
+
   return
 }
 
-func.func @mulsi_mului_extended_overflows() {
-  // mulsi and mului extended versions, with overflow
-  // mulsi_extended -100, -100 : i8 = (16, 39); mului_extended -100, -100 : i8 = (16, 95)
+func.func @mulsi_extended_i8(%v1 : i8, %v2 : i8) -> (i8, i8) {
+  %low, %high = arith.mulsi_extended %v1, %v2 : i8
+  vector.print %low : i8
+  vector.print %high : i8
+  func.return %low, %high : i8, i8
+}
+
+func.func @mulsi_extended_overflows() {
+  // mulsi extended versions, with overflow
+  %c_100_i8 = arith.constant -100 : i8
+
+  // mulsi_extended -100, -100 : i8 = (16, 39)
   // CHECK-NEXT:  16
   // CHECK-NEXT:  39
-  // CHECK-NEXT:  16
-  // CHECK-NEXT:  95
-  %c-100_i8 = arith.constant -100 : i8
-  %low, %high = arith.mulsi_extended %c-100_i8, %c-100_i8 : i8
+  func.call @mulsi_extended_i8(%c_100_i8, %c_100_i8) : (i8, i8) -> (i8, i8)
+  return
+}
+
+func.func @mului_extended_i8(%v1 : i8, %v2 : i8) -> (i8, i8) {
+  %low, %high = arith.mului_extended %v1, %v2 : i8
   vector.print %low : i8
   vector.print %high : i8
-  %low_0, %high_1 = arith.mului_extended %c-100_i8, %c-100_i8 : i8
-  vector.print %low_0 : i8
-  vector.print %high_1 : i8
+  func.return %low, %high : i8, i8
+}
+
+func.func @mului_extended_overflows() -> () {
+  %c_100_i8 = arith.constant -100 : i8
+
+  // mului_extended -100, -100 : i8 = (16, 95)
+  // CHECK-NEXT:  16
+  // CHECK-NEXT:  95
+  func.call @mului_extended_i8(%c_100_i8, %c_100_i8) : (i8, i8) -> (i8, i8)
   return
 }
 
 func.func @entry() {
   func.call @mulsi_extended_on_i1() : () -> ()
-  func.call @mulsi_mului_extended_overflows() : () -> ()
+  func.call @mulsi_extended_overflows() : () -> ()
+  func.call @mului_extended_overflows() : () -> ()
   return
 }

>From 6c5ae8938e64b8e5dbf63d7733b8a71e5e7514c7 Mon Sep 17 00:00:00 2001
From: pingshiyu <pingshiyu at gmail.com>
Date: Sat, 29 Jun 2024 21:11:08 +0100
Subject: [PATCH 4/7] added equivalent reprs

---
 .../Dialect/Arith/CPU/multiplication.mlir     | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
index 8514b8018683bb..9bcda62b15e099 100644
--- a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
+++ b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
@@ -66,12 +66,27 @@ func.func @mului_extended_i8(%v1 : i8, %v2 : i8) -> (i8, i8) {
 }
 
 func.func @mului_extended_overflows() -> () {
-  %c_100_i8 = arith.constant -100 : i8
+  %c_n100_i8 = arith.constant -100 : i8
+  %c_156_i8 = arith.constant 156 : i8
 
   // mului_extended -100, -100 : i8 = (16, 95)
+  // and on equivalent representations (e.g. 156 === -100 (mod 256))
+
+  // CHECK-NEXT:  16
+  // CHECK-NEXT:  95
+  func.call @mului_extended_i8(%c_n100_i8, %c_n100_i8) : (i8, i8) -> (i8, i8)
+
+  // CHECK-NEXT:  16
+  // CHECK-NEXT:  95
+  func.call @mului_extended_i8(%c_n100_i8, %c_156_i8) : (i8, i8) -> (i8, i8)
+
+  // CHECK-NEXT:  16
+  // CHECK-NEXT:  95
+  func.call @mului_extended_i8(%c_156_i8, %c_n100_i8) : (i8, i8) -> (i8, i8)
+
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
-  func.call @mului_extended_i8(%c_100_i8, %c_100_i8) : (i8, i8) -> (i8, i8)
+  func.call @mului_extended_i8(%c_156_i8, %c_156_i8) : (i8, i8) -> (i8, i8)
   return
 }
 

>From e13fcb798c96d3b3626eacf2d7b7523ec7fa2761 Mon Sep 17 00:00:00 2001
From: pingshiyu <pingshiyu at gmail.com>
Date: Mon, 1 Jul 2024 15:22:22 +0100
Subject: [PATCH 5/7] added labels, merged test functions together

---
 .../Dialect/Arith/CPU/multiplication.mlir     | 73 +++++++++++++------
 1 file changed, 49 insertions(+), 24 deletions(-)

diff --git a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
index 9bcda62b15e099..6fdef1401f87e4 100644
--- a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
+++ b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
@@ -9,81 +9,107 @@
 // RUN:   FileCheck %s --match-full-lines
 
 func.func @mulsi_extended_i1(%v1 : i1, %v2 : i1) -> (i1, i1) {
+  vector.print str "@mulsi_extended_i1\n"
   %low, %high = arith.mulsi_extended %v1, %v2 : i1
   vector.print %low : i1
   vector.print %high : i1
   func.return %low, %high : i1, i1
 }
 
-func.func @mulsi_extended_on_i1() {
+func.func @mulsi_extended_i8(%v1 : i8, %v2 : i8) -> (i8, i8) {
+  vector.print str "@mulsi_extended_i8\n"
+  %low, %high = arith.mulsi_extended %v1, %v2 : i8
+  vector.print %low : i8
+  vector.print %high : i8
+  func.return %low, %high : i8, i8
+}
+
+func.func @mulsi_extended() {
+  // ------------------------------------------------
+  // Test i1
+  // ------------------------------------------------
+
   // mulsi_extended on i1, tests for overflow bit
   // mulsi_extended 1, 1 : i1 = (1, 0)
   %true = arith.constant true
   %false = arith.constant false
 
-  // CHECK:      1
-  // CHECK-NEXT: 0
+  // CHECK-LABEL: @mulsi_extended_i1
+  // CHECK-NEXT:  1
+  // CHECK-NEXT:  0
   func.call @mulsi_extended_i1(%true, %true) : (i1, i1) -> (i1, i1)
 
-  // CHECK-NEXT: 0
-  // CHECK-NEXT: 0
+  // CHECK-LABEL: @mulsi_extended_i1
+  // CHECK-NEXT:  0
+  // CHECK-NEXT:  0
   func.call @mulsi_extended_i1(%true, %false) : (i1, i1) -> (i1, i1)
 
-  // CHECK-NEXT: 0
-  // CHECK-NEXT: 0
+  // CHECK-LABEL: @mulsi_extended_i1
+  // CHECK-NEXT:  0
+  // CHECK-NEXT:  0
   func.call @mulsi_extended_i1(%false, %true) : (i1, i1) -> (i1, i1)
 
-  // CHECK-NEXT: 0
-  // CHECK-NEXT: 0
+  // CHECK-LABEL: @mulsi_extended_i1
+  // CHECK-NEXT:  0
+  // CHECK-NEXT:  0
   func.call @mulsi_extended_i1(%false, %false) : (i1, i1) -> (i1, i1)
 
-  return
-}
-
-func.func @mulsi_extended_i8(%v1 : i8, %v2 : i8) -> (i8, i8) {
-  %low, %high = arith.mulsi_extended %v1, %v2 : i8
-  vector.print %low : i8
-  vector.print %high : i8
-  func.return %low, %high : i8, i8
-}
-
-func.func @mulsi_extended_overflows() {
+  // ------------------------------------------------
+  // Test i8
+  // ------------------------------------------------
   // mulsi extended versions, with overflow
   %c_100_i8 = arith.constant -100 : i8
 
   // mulsi_extended -100, -100 : i8 = (16, 39)
+  // CHECK-LABEL: @mulsi_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  39
   func.call @mulsi_extended_i8(%c_100_i8, %c_100_i8) : (i8, i8) -> (i8, i8)
+
+  // ------------------------------------------------
+  // Test i16, i32 etc.. TODO
+  // ------------------------------------------------
   return
 }
 
 func.func @mului_extended_i8(%v1 : i8, %v2 : i8) -> (i8, i8) {
+  vector.print str "@mului_extended_i8\n"
   %low, %high = arith.mului_extended %v1, %v2 : i8
   vector.print %low : i8
   vector.print %high : i8
   func.return %low, %high : i8, i8
 }
 
-func.func @mului_extended_overflows() -> () {
+func.func @mului_extended() -> () {
+  // ------------------------------------------------
+  // Test i1, i16, i32 etc.. TODO
+  // ------------------------------------------------
+
+  // ------------------------------------------------
+  // Test i8
+  // ------------------------------------------------
   %c_n100_i8 = arith.constant -100 : i8
   %c_156_i8 = arith.constant 156 : i8
 
   // mului_extended -100, -100 : i8 = (16, 95)
   // and on equivalent representations (e.g. 156 === -100 (mod 256))
 
+  // CHECK-LABEL: @mului_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
   func.call @mului_extended_i8(%c_n100_i8, %c_n100_i8) : (i8, i8) -> (i8, i8)
 
+  // CHECK-LABEL: @mului_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
   func.call @mului_extended_i8(%c_n100_i8, %c_156_i8) : (i8, i8) -> (i8, i8)
 
+  // CHECK-LABEL: @mului_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
   func.call @mului_extended_i8(%c_156_i8, %c_n100_i8) : (i8, i8) -> (i8, i8)
 
+  // CHECK-LABEL: @mului_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
   func.call @mului_extended_i8(%c_156_i8, %c_156_i8) : (i8, i8) -> (i8, i8)
@@ -91,8 +117,7 @@ func.func @mului_extended_overflows() -> () {
 }
 
 func.func @entry() {
-  func.call @mulsi_extended_on_i1() : () -> ()
-  func.call @mulsi_extended_overflows() : () -> ()
-  func.call @mului_extended_overflows() : () -> ()
+  func.call @mulsi_extended() : () -> ()
+  func.call @mului_extended() : () -> ()
   return
 }

>From 22bf7626acd2b94bd39ecd95c7119305d7898900 Mon Sep 17 00:00:00 2001
From: pingshiyu <pingshiyu at gmail.com>
Date: Tue, 2 Jul 2024 22:21:51 +0100
Subject: [PATCH 6/7] removed function return values

---
 .../Dialect/Arith/CPU/multiplication.mlir     | 32 +++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
index 6fdef1401f87e4..4a0670663fd185 100644
--- a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
+++ b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
@@ -8,20 +8,20 @@
 // RUN:                   --shared-libs=%mlir_c_runner_utils | \
 // RUN:   FileCheck %s --match-full-lines
 
-func.func @mulsi_extended_i1(%v1 : i1, %v2 : i1) -> (i1, i1) {
+func.func @mulsi_extended_i1(%v1 : i1, %v2 : i1) {
   vector.print str "@mulsi_extended_i1\n"
   %low, %high = arith.mulsi_extended %v1, %v2 : i1
   vector.print %low : i1
   vector.print %high : i1
-  func.return %low, %high : i1, i1
+  return
 }
 
-func.func @mulsi_extended_i8(%v1 : i8, %v2 : i8) -> (i8, i8) {
+func.func @mulsi_extended_i8(%v1 : i8, %v2 : i8) {
   vector.print str "@mulsi_extended_i8\n"
   %low, %high = arith.mulsi_extended %v1, %v2 : i8
   vector.print %low : i8
   vector.print %high : i8
-  func.return %low, %high : i8, i8
+  return
 }
 
 func.func @mulsi_extended() {
@@ -37,22 +37,22 @@ func.func @mulsi_extended() {
   // CHECK-LABEL: @mulsi_extended_i1
   // CHECK-NEXT:  1
   // CHECK-NEXT:  0
-  func.call @mulsi_extended_i1(%true, %true) : (i1, i1) -> (i1, i1)
+  func.call @mulsi_extended_i1(%true, %true) : (i1, i1) -> ()
 
   // CHECK-LABEL: @mulsi_extended_i1
   // CHECK-NEXT:  0
   // CHECK-NEXT:  0
-  func.call @mulsi_extended_i1(%true, %false) : (i1, i1) -> (i1, i1)
+  func.call @mulsi_extended_i1(%true, %false) : (i1, i1) -> ()
 
   // CHECK-LABEL: @mulsi_extended_i1
   // CHECK-NEXT:  0
   // CHECK-NEXT:  0
-  func.call @mulsi_extended_i1(%false, %true) : (i1, i1) -> (i1, i1)
+  func.call @mulsi_extended_i1(%false, %true) : (i1, i1) -> ()
 
   // CHECK-LABEL: @mulsi_extended_i1
   // CHECK-NEXT:  0
   // CHECK-NEXT:  0
-  func.call @mulsi_extended_i1(%false, %false) : (i1, i1) -> (i1, i1)
+  func.call @mulsi_extended_i1(%false, %false) : (i1, i1) -> ()
 
   // ------------------------------------------------
   // Test i8
@@ -64,7 +64,7 @@ func.func @mulsi_extended() {
   // CHECK-LABEL: @mulsi_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  39
-  func.call @mulsi_extended_i8(%c_100_i8, %c_100_i8) : (i8, i8) -> (i8, i8)
+  func.call @mulsi_extended_i8(%c_100_i8, %c_100_i8) : (i8, i8) -> ()
 
   // ------------------------------------------------
   // Test i16, i32 etc.. TODO
@@ -72,15 +72,15 @@ func.func @mulsi_extended() {
   return
 }
 
-func.func @mului_extended_i8(%v1 : i8, %v2 : i8) -> (i8, i8) {
+func.func @mului_extended_i8(%v1 : i8, %v2 : i8) {
   vector.print str "@mului_extended_i8\n"
   %low, %high = arith.mului_extended %v1, %v2 : i8
   vector.print %low : i8
   vector.print %high : i8
-  func.return %low, %high : i8, i8
+  return
 }
 
-func.func @mului_extended() -> () {
+func.func @mului_extended() {
   // ------------------------------------------------
   // Test i1, i16, i32 etc.. TODO
   // ------------------------------------------------
@@ -97,22 +97,22 @@ func.func @mului_extended() -> () {
   // CHECK-LABEL: @mului_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
-  func.call @mului_extended_i8(%c_n100_i8, %c_n100_i8) : (i8, i8) -> (i8, i8)
+  func.call @mului_extended_i8(%c_n100_i8, %c_n100_i8) : (i8, i8) -> ()
 
   // CHECK-LABEL: @mului_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
-  func.call @mului_extended_i8(%c_n100_i8, %c_156_i8) : (i8, i8) -> (i8, i8)
+  func.call @mului_extended_i8(%c_n100_i8, %c_156_i8) : (i8, i8) -> ()
 
   // CHECK-LABEL: @mului_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
-  func.call @mului_extended_i8(%c_156_i8, %c_n100_i8) : (i8, i8) -> (i8, i8)
+  func.call @mului_extended_i8(%c_156_i8, %c_n100_i8) : (i8, i8) -> ()
 
   // CHECK-LABEL: @mului_extended_i8
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
-  func.call @mului_extended_i8(%c_156_i8, %c_156_i8) : (i8, i8) -> (i8, i8)
+  func.call @mului_extended_i8(%c_156_i8, %c_156_i8) : (i8, i8) -> ()
   return
 }
 

>From a2068a1535bb9ee874b9d09c87e2864c9055adce Mon Sep 17 00:00:00 2001
From: pingshiyu <pingshiyu at gmail.com>
Date: Sat, 6 Jul 2024 15:06:57 +0100
Subject: [PATCH 7/7] updates based on comments

---
 .../Dialect/Arith/CPU/multiplication.mlir          | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
index 4a0670663fd185..21fd816788431e 100644
--- a/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
+++ b/mlir/test/Integration/Dialect/Arith/CPU/multiplication.mlir
@@ -1,7 +1,3 @@
-// Tests mul operations and their variants (e.g. extended).
-// These tests are intended to be target agnostic: they should yield the same results 
-// regardless of the target platform.
-
 // RUN: mlir-opt %s --convert-scf-to-cf --convert-cf-to-llvm --convert-vector-to-llvm \
 // RUN:             --convert-func-to-llvm --convert-arith-to-llvm | \
 // RUN:   mlir-cpu-runner -e entry -entry-point-result=void \
@@ -67,7 +63,7 @@ func.func @mulsi_extended() {
   func.call @mulsi_extended_i8(%c_100_i8, %c_100_i8) : (i8, i8) -> ()
 
   // ------------------------------------------------
-  // Test i16, i32 etc.. TODO
+  // TODO: Test i16, i32 etc.. 
   // ------------------------------------------------
   return
 }
@@ -81,10 +77,6 @@ func.func @mului_extended_i8(%v1 : i8, %v2 : i8) {
 }
 
 func.func @mului_extended() {
-  // ------------------------------------------------
-  // Test i1, i16, i32 etc.. TODO
-  // ------------------------------------------------
-
   // ------------------------------------------------
   // Test i8
   // ------------------------------------------------
@@ -113,6 +105,10 @@ func.func @mului_extended() {
   // CHECK-NEXT:  16
   // CHECK-NEXT:  95
   func.call @mului_extended_i8(%c_156_i8, %c_156_i8) : (i8, i8) -> ()
+
+  // ------------------------------------------------
+  // TODO: Test i1, i16, i32 etc.. 
+  // ------------------------------------------------
   return
 }
 



More information about the Mlir-commits mailing list