[Openmp-commits] [PATCH] D149010: [OpenMP] Fix GCC build issues and restore "Additional APIs used by the MSVC compiler for loop collapse (rectangular and non-rectangular loops)"

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue May 16 09:55:16 PDT 2023


jhuber6 added inline comments.


================
Comment at: openmp/runtime/src/kmp_collapse.cpp:132
+          static_cast<kmp_loop_nest_iv_t>(bounds->ub0 - bounds->lb0) /
+              std::abs(bounds->step) +
+          1;
----------------
tianshilei1992 wrote:
> I'm not sure if we can use `std::abs` here w/o pulling in `<cmath>`. However, `libomp` doesn't depend on `libm` anyway, so we might probably just want to "reinvent the wheels" for `std::abs` here.
If this was C++23 we could rely on them being constexpr. I think most implementations will provide this without `cmath`, but it's certainly possible to call into `libm` so it's safest to avoid the reference.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149010



More information about the Openmp-commits mailing list