[llvm] [KnownFPClass] Improve known class deductions for exp/exp2/exp10 (PR #217526)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 22:52:54 PDT 2026


================
@@ -520,16 +520,19 @@ KnownFPClass KnownFPClass::exp(const KnownFPClass &KnownSrc) {
 
   Known.propagateNonNaN(KnownSrc);
 
-  if (KnownSrc.cannotBeOrderedLessThanZero()) {
-    // If the source is positive this cannot underflow.
+  // Only a negative normal or negative infinity can produce positive zero.
+  // A negative subnormal input is too small to produce positive zero.
----------------
ZERICO2005 wrote:

`InstCombineSimplifyDemanded` also performs the exact same deductions.
https://github.com/llvm/llvm-project/blob/849e90e010f7fa566c94a5d84a2b21cbdb159476/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp#L3101

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


More information about the llvm-commits mailing list