[PATCH] D137858: ConstantFolding: Constant fold some canonicalizes

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 14:59:58 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:1948
+                                          const APFloat &Src) {
+  // I sure hope zero, positive and negative, is always OK to fold.
+  if (Src.isZero())
----------------
jcranmer-intel wrote:
> spatel wrote:
> > Delete the "I sure hope" - if we're coding it this way, it's the law. If there's fallout, it'll change. :)
> If I'm reading the source code of APFloat, and of glibc, correctly, then APFloat considers {0.0, *} to be isZero() for ppc_fp128, which shouldn't be considered a canonical value.
> 
> You should be fine for x86_fp80.
https://reviews.llvm.org/D138331


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

https://reviews.llvm.org/D137858



More information about the llvm-commits mailing list