[Mlir-commits] [mlir] [mlir][arith] Add more patterns to mulf	folder (PR #161395)
    Xiang Li 
    llvmlistbot at llvm.org
       
    Tue Sep 30 10:02:28 PDT 2025
    
    
  
================
@@ -2216,6 +2216,16 @@ func.func @test_mulf1(%arg0 : f32, %arg1 : f32) -> (f32) {
   return %2 : f32
 }
 
+// CHECK-LABEL: @test_mulf2(
+func.func @test_mulf2(%arg0 : f32, %arg1 : f32) -> (f32, f32) {
+  // CHECK-NEXT:  %[[C0:.+]] = arith.constant 0.000000e+00 : f32
+  // CHECK-NEXT:  return %[[C0]], %[[C0]]
+  %c0 = arith.constant 0.0 : f32
+  %0 = arith.mulf %arg0, %c0 : f32
+  %1 = arith.mulf %c0, %arg1 : f32
+  return %0, %1  : f32, f32
+}
----------------
python3kgae wrote:
Fixed by fold NaN before 0.
https://github.com/llvm/llvm-project/pull/161395
    
    
More information about the Mlir-commits
mailing list