[PATCH] D144534: [InstCombine] Fold (fcmp_oeq (fabs x) +Inf) into is_fpclass(x, fcInf)
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 22 04:37:58 PST 2023
arsenm added a comment.
I think this is a backwards canonicalization decision and fabs + fcmp will be more broadly understood
================
Comment at: llvm/test/Transforms/InstCombine/create-class-from-logic-fcmp.ll:1160
; CHECK-LABEL: @not_negisnormalinf_or_inf(
-; CHECK-NEXT: [[FABS:%.*]] = call half @llvm.fabs.f16(half [[X:%.*]])
-; CHECK-NEXT: [[NOT_IS_NEG_NORMAL_INF:%.*]] = fcmp ult half [[X]], 0xH0400
-; CHECK-NEXT: [[IS_INF:%.*]] = fcmp oeq half [[FABS]], 0xH7C00
-; CHECK-NEXT: [[OR:%.*]] = or i1 [[NOT_IS_NEG_NORMAL_INF]], [[IS_INF]]
-; CHECK-NEXT: ret i1 [[OR]]
+; CHECK-NEXT: [[IS_INF:%.*]] = call i1 @llvm.is.fpclass.f16(half [[X:%.*]], i32 767)
+; CHECK-NEXT: ret i1 [[IS_INF]]
----------------
This improvement will be picked up whenever my patch to combine class+fcmp lands
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144534/new/
https://reviews.llvm.org/D144534
More information about the llvm-commits
mailing list