23 Commits

Author SHA1 Message Date
Matt Arsenault
880ed01100
ValueTracking: Move powi logic to KnownFPClass (#179301)
This case is kind of ugly because we still need to look at the
known bits to short circuit the source check
2026-02-02 19:18:49 +00:00
Matt Arsenault
32ccf4eed0
ValueTracking: Move ldexp KnownFPClass handling to support (#179235)
Will enable code sharing with SImplifyDemandedFPClass, SelectionDAG
and GlobalISel.
2026-02-02 18:23:07 +00:00
Matt Arsenault
a692d171ec
ValueTracking: log never returns denormal (#178234) 2026-01-27 17:56:23 +01:00
Matt Arsenault
81fa743e3d
ValueTracking: Move sin/cos computeKnownFPClass handling to support (#178240)
These are the same for now but keep the separate names for future
use.
2026-01-27 17:47:29 +01:00
Matt Arsenault
f8a4091f15
ValueTracking: Improve nan tracking for fma square special case (#175999)
In the square multiply case, we can infer if the add of opposite
sign infinities can occur.
2026-01-24 12:42:25 +01:00
Matt Arsenault
0993d69bc3
InstCombine: Handle fdiv in SimplifyDemandedFPClass (#175946) 2026-01-24 11:37:04 +00:00
Matt Arsenault
aa53f6f3db
ValueTracking: Improve handling for fma/fmuladd (#175614)
The handling for fma was very basic and only handled the
repeated input case. Re-use the fmul and fadd handling for more
accurate sign bit and nan handling.
2026-01-24 11:35:14 +01:00
Matt Arsenault
0387625c3e
ValueTracking: Detect cases with no underflow for fadd (#177746)
In the case where both operands have the same sign,
as long as one of the operands is normal or infinity,
the result cannot underflow to a zero.

Pre-committing for #175614
2026-01-24 09:50:01 +00:00
Matt Arsenault
403502f478
InstCombine: Implement SimplifyDemandedFPClass for frexp (#176122) 2026-01-24 08:11:50 +01:00
Matt Arsenault
c991fdd4bc
InstCombine: Handle fsub in SimplifyDemandedFPClass (#175852)
alive2 fails on some of the tests, but this is due to existing
folds in instsimplify and
https://github.com/AliveToolkit/alive2/issues/1273
2026-01-23 23:59:02 +01:00
Matt Arsenault
6000703ba8
InstCombine: Handle fptrunc in SimplifyDemandedFPClass (#175421)
Also handle llvm.fptrunc.round since it's the same.
2026-01-23 23:40:59 +01:00
Matt Arsenault
4a9a13cb8c
InstCombine: Handle fadd in SimplifyDemandedFPClass (#174853)
Note some of the tests currently fail with alive, but not
due to this patch. Namely, when performing the fadd x, 0 -> x
simplification in functions with non-IEEE denormal handling.
The existing instsimplify ignores the denormals-are-zero hazard by
checking cannotBeNegativeZero instead of isKnownNeverLogicalZero.

Also note the self handling doesn't really do anything yet, other
than propagate consistent known-fpclass information until there is
multiple use support.

This also leaves behind the original ValueTracking support, without
switching to the new KnownFPClass:fadd utility. This will be easier
to clean up after the subsequent fsub support patch.
2026-01-13 17:28:35 +01:00
Matt Arsenault
acfc31a4a7
InstCombine: Handle rounding intrinsics in SimplifyDemandedFPClass (#174842) 2026-01-12 18:51:44 +00:00
Matt Arsenault
3ad028173b
ValueTracking: sqrt never returns subnormal (#174846) 2026-01-11 18:07:53 +00:00
Matt Arsenault
99ab1dd145
InstCombine: Implement SimplifyDemandedFPClass for sqrt (#173883) 2026-01-11 11:42:41 +00:00
Matt Arsenault
7e4f390c38
InstCombine: Handle fpext in SimplifyDemandedFPClass (#174849) 2026-01-11 11:46:50 +01:00
Matt Arsenault
e29abeae77
InstCombine: Handle log/log2/log10 in SimplifyDemandedFPClass (#173881) 2026-01-07 19:37:21 +01:00
Matt Arsenault
f38e54ee83
InstCombine: Handle minimum/maximum in SimplifyDemandedFPClass (#173897) 2026-01-07 19:35:04 +01:00
Matt Arsenault
28de3c1576
InstCombine: Handle fmul in SimplifyDemandedFPClass (#173872) 2026-01-07 17:34:23 +01:00
Matt Arsenault
e4722c69b8
InstCombine: Handle exp/exp2/exp10 in SimplifyDemandedFPClass (#173432)
I'm working on optimizing out the tail sequences in the
implementations of the 4 different flavors of pow. These
include chains of selects on the various edge cases.

Related to #64870
2025-12-29 15:03:13 +00:00
Matt Arsenault
c8d7e53749
InstCombine: Handle canonicalize in SimplifyDemandedFPClass (#173189) 2025-12-29 14:32:12 +01:00
Matt Arsenault
6785c40bfd
ValueTracking: Avoid calling computeKnownFPClass on matched constant (#173248)
The fmul case already tries to match a literal value, we don't
need to match it twice.
2025-12-24 23:01:56 +00:00
Tim Gymnich
049f179606
[Analysis][NFC] Extract KnownFPClass (#133457)
- extract KnownFPClass for future use inside of GISelKnownBits

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2025-03-28 18:10:02 +01:00