[Mlir-commits] [mlir] [MLIR][Math] Add floating point value folders (PR #127947)
Ivan R. Ivanov
llvmlistbot at llvm.org
Wed Feb 19 19:06:02 PST 2025
================
@@ -492,3 +492,75 @@ func.func @abs_poison() -> f32 {
%1 = math.absf %0 : f32
return %1 : f32
}
+
+// CHECK-LABEL: @isfinite_fold
+// CHECK: %[[cst:.+]] = arith.constant true
+ // CHECK: return %[[cst]]
+func.func @isfinite_fold() -> i1 {
+ %c = arith.constant 2.0 : f32
+ %r = math.isfinite %c : f32
+ return %r : i1
+}
+
+// CHECK-LABEL: @isfinite_fold_vec
+// CHECK: %[[cst:.+]] = arith.constant dense<true>
----------------
ivanradanov wrote:
Could we add the result type in the checks?
https://github.com/llvm/llvm-project/pull/127947
More information about the Mlir-commits
mailing list