[PATCH] D147902: ValueTracking: Implement computeKnownFPClass for fpext

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 16:45:28 PDT 2023

arsenm marked an inline comment as done.
arsenm added inline comments.

Comment at: llvm/lib/Analysis/ValueTracking.cpp:4598-4602
+    // All subnormal inputs should be in the normal range in the result type.
+    if (APFloat::semanticsMinExponent(DstTy) <
+            APFloat::semanticsMinExponent(SrcTy) &&
+        APFloat::semanticsMaxExponent(DstTy) >
+            APFloat::semanticsMaxExponent(SrcTy))
arsenm wrote:
> jcranmer-intel wrote:
> > If the mantissa is sufficiently long, then a subnormal could still be a subnormal in a number with longer range. While this holds true for all the >=16-bit fp types, I'm not sure this holds true for the different FP8 types.
> I missed fltSemantics::isRepresentableBy (don't understand why fltSemantics is treated so opaquely)
Which also seems to not behave as expected for the bf16->f32 case 



More information about the llvm-commits mailing list