[llvm] [InstCombine] Fold `fcmp pred sqrt(X), 0.0 -> fcmp pred2 X, 0.0` (PR #101626)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 07:09:29 PDT 2024
================
@@ -2266,6 +2296,17 @@ define i1 @fcmp_sqrt_zero_uno(half %x) {
ret i1 %cmp
}
+; Make sure that ninf is cleared.
+define i1 @fcmp_sqrt_zero_uno_fmf(half %x) {
+; CHECK-LABEL: @fcmp_sqrt_zero_uno_fmf(
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult half [[X:%.*]], 0xH0000
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %sqrt = call half @llvm.sqrt(half %x)
----------------
arsenm wrote:
Missing type suffixes on all the sqrt calls.
Also, can you keep ninf if the sqrt is also ninf?
https://github.com/llvm/llvm-project/pull/101626
More information about the llvm-commits
mailing list