[PATCH] D83051: [flang][NFC] Move and rework pgmath description used in folding

Jean Perier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 09:42:32 PDT 2020


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


================
Comment at: flang/lib/Evaluate/intrinsics-library.cpp:174
     HostIntrinsicProceduresLibrary &hostIntrinsicLibrary) {
-  static_assert(std::is_same_v<HostT, float> || std::is_same_v<HostT, double>);
-  HostRuntimeIntrinsicProcedure pgmathSymbols[]{
-      {"acos", Sym<Lib, I::acos, HostT>, true},
-      {"acosh", Sym<Lib, I::acosh, HostT>, true},
-      {"asin", Sym<Lib, I::asin, HostT>, true},
-      {"asinh", Sym<Lib, I::asinh, HostT>, true},
-      {"atan", Sym<Lib, I::atan, HostT>, true},
-      {"atan", Sym<Lib, I::atan2, HostT>,
-          true}, // atan is also the generic name for atan2
-      {"atanh", Sym<Lib, I::atanh, HostT>, true},
-      {"bessel_j0", Sym<Lib, I::bessel_j0, HostT>, true},
-      {"bessel_j1", Sym<Lib, I::bessel_j1, HostT>, true},
-      {"bessel_jn", Sym<Lib, I::bessel_jn, HostT>, true},
-      {"bessel_y0", Sym<Lib, I::bessel_y0, HostT>, true},
-      {"bessel_y1", Sym<Lib, I::bessel_y1, HostT>, true},
-      {"bessel_yn", Sym<Lib, I::bessel_yn, HostT>, true},
-      {"cos", Sym<Lib, I::cos, HostT>, true},
-      {"cosh", Sym<Lib, I::cosh, HostT>, true},
-      {"erf", Sym<Lib, I::erf, HostT>, true},
-      {"erfc", Sym<Lib, I::erfc, HostT>, true},
-      {"erfc_scaled", Sym<Lib, I::erfc_scaled, HostT>, true},
-      {"exp", Sym<Lib, I::exp, HostT>, true},
-      {"gamma", Sym<Lib, I::gamma, HostT>, true},
-      {"hypot", Sym<Lib, I::hypot, HostT>, true},
-      {"log", Sym<Lib, I::log, HostT>, true},
-      {"log10", Sym<Lib, I::log10, HostT>, true},
-      {"log_gamma", Sym<Lib, I::log_gamma, HostT>, true},
-      {"mod", Sym<Lib, I::mod, HostT>, true},
-      {"pow", Sym<Lib, I::pow, HostT>, true},
-      {"sin", Sym<Lib, I::sin, HostT>, true},
-      {"sinh", Sym<Lib, I::sinh, HostT>, true},
-      {"sqrt", Sym<Lib, I::sqrt, HostT>, true},
-      {"tan", Sym<Lib, I::tan, HostT>, true},
-      {"tanh", Sym<Lib, I::tanh, HostT>, true},
-  };
+  // FIXME: atan / atan2 !
+  if constexpr (Lib == L::F) {
----------------
sscalpone wrote:
> What needs to be fixed?
Old comment. It was a folding regression that was actually fixed by using "atan2" for the "atan" with two arguments (change in fold-real.cc)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83051





More information about the llvm-commits mailing list