[PATCH] D139316: ValueTracking: Teach isKnownNeverInfinity about rounding intrinsics

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 11:12:05 PST 2022


arsenm added inline comments.


================
Comment at: llvm/include/llvm/IR/Type.h:189-194
+  /// Returns true if this floating-point type with APFloat::IEEEFloat
+  /// representation (i.e. not ppc_fp128).
+  bool isIEEEFloatRepresentationTy() const {
+    return isIEEELikeFPTy() || getTypeID() == X86_FP80TyID;
+  }
+
----------------
sepavloff wrote:
> What you need for this patch is availability of fixed size mantissa. Custom short FP types, like 8 and 16 bit floats may be non-IEEE in strict sense but they still provide definite number of mantissa bits.
> 
> I would propose to use `isPPC_FP128Ty` to filter out indeterminate precision formats  or, if you want, to define a predicate like:
> ```
> /// Returns true if this floating-point type represents unevaluated sum of shorter floating-point values.
> bool isMultiWordFPType() const {
>     return getTypeID() == PPC_FP128TyID;
> }
> ```
> If someone uses additional types with such property in their LLVM-based compilers, they can extend this function.
Word is a bit overloaded, and someone might read this as word == 4 bytes 


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

https://reviews.llvm.org/D139316



More information about the llvm-commits mailing list