[PATCH] D147902: ValueTracking: Implement computeKnownFPClass for fpext

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


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:
> 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 
Which would be because it doesn't have the same purpose 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147902/new/

https://reviews.llvm.org/D147902



More information about the llvm-commits mailing list