[Mlir-commits] [mlir] [mlir][arith] Overflow flags propagation in arith canonicalizations. (PR #91646)

Ivan Butygin llvmlistbot at llvm.org
Fri May 10 02:29:12 PDT 2024


================
@@ -1051,6 +1193,17 @@ func.func @addiMuliToSubiLhsI32(%arg0: i32, %arg1: i32) -> i32 {
   return %add : i32
 }
 
+// CHECK-LABEL: @addiMuliToSubiLhsI32Ovf
+//  CHECK-SAME:   (%[[ARG0:.+]]: i32, %[[ARG1:.+]]: i32)
+//       CHECK:   %[[SUB:.+]] = arith.subi %[[ARG0]], %[[ARG1]] overflow<nsw, nuw> : i32
+//       CHECK:   return %[[SUB]]
+func.func @addiMuliToSubiLhsI32Ovf(%arg0: i32, %arg1: i32) -> i32 {
----------------
Hardcode84 wrote:

+1, some script which can run entire arith canonicalization suite through alive2 will be extremely useful. I can think about it and switch this PR to draft fro now.

https://github.com/llvm/llvm-project/pull/91646


More information about the Mlir-commits mailing list