[PATCH] D102672: [ConstantFolding] Use APFloat for constant folding. NFC

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 18 10:12:24 PDT 2021


efriedma added inline comments.


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:2146
     case LibFunc_logf_finite:
-      if (V > 0.0 && TLI->has(Func))
-        return ConstantFoldFP(log, V, Ty);
+      if (!APF.isNegative() && !APF.isZero() && TLI->has(Func))
+        return ConstantFoldFP(log, APF, Ty);
----------------
sepavloff wrote:
> efriedma wrote:
> > This isn't precisely equivalent to the existing code.
> Could you please point out the case when this code behaves differently from the existing one?
This handles NaNs differently.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102672



More information about the llvm-commits mailing list