[llvm] [InstCombine] Handle isNanOrInf idioms (PR #80414)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 08:26:42 PST 2024


================
@@ -75,6 +75,32 @@ define i1 @f32_fcnan(float %a) {
   ret i1 %res
 }
 
+define i1 @f32_fcnan_fcinf_strictfp(float %a) strictfp {
+; CHECK-LABEL: define i1 @f32_fcnan_fcinf_strictfp(
+; CHECK-SAME: float [[A:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:    [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[A]])
+; CHECK-NEXT:    [[CMP:%.*]] = fcmp ueq float [[TMP1]], 0x7FF0000000000000
----------------
ostannard wrote:

I think this is an old bug but this patch has caused us to start hitting it in our floating-point library, I've posted a fix at #81498.

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


More information about the llvm-commits mailing list