[Mlir-commits] [mlir] [MLIR] Add canonicalizations to all eligible `index` binary ops (PR #114000)

Nachi G llvmlistbot at llvm.org
Wed Oct 30 13:54:17 PDT 2024


================
@@ -65,6 +65,19 @@ func.func @mul() -> index {
   return %2 : index
 }
 
+// CHECK-LABEL: @mul_fold_constants
+func.func @mul_fold_constants(%arg: index) -> (index) {
+  %0 = index.constant 2
+  %1 = index.constant 3
+  %2 = index.mul %arg, %0
+  %3 = index.mul %2, %1
+
+  // CHECK-DAG: [[C6:%.*]] = index.constant 6
----------------
nacgarg wrote:

Thanks, updated!

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


More information about the Mlir-commits mailing list