[llvm] [InstCombine] Generalize fold of `fcmp + copysign` (PR #86387)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 09:44:00 PDT 2024
================
@@ -596,8 +596,8 @@ define i1 @is_signbit_set(double %x) {
define i1 @is_signbit_set_1(double %x) {
; CHECK-LABEL: @is_signbit_set_1(
-; CHECK-NEXT: [[S:%.*]] = call double @llvm.copysign.f64(double 1.000000e+00, double [[X:%.*]])
-; CHECK-NEXT: [[R:%.*]] = fcmp ult double [[S]], 0.000000e+00
+; CHECK-NEXT: [[TMP1:%.*]] = bitcast double [[X:%.*]] to i64
+; CHECK-NEXT: [[R:%.*]] = icmp slt i64 [[TMP1]], 0
----------------
arsenm wrote:
If it returns an i1, that wouldn't really be any better. It still wouldn't be a candidate for tracking. If we returned the signbit encoded in the original FP type, it may be more useful
https://github.com/llvm/llvm-project/pull/86387
More information about the llvm-commits
mailing list