[Openmp-commits] [PATCH] D149490: [OpenMP] In libomptarget, assume alignment at powers of two

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon May 1 15:52:47 PDT 2023


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


================
Comment at: openmp/libomptarget/src/omptarget.cpp:112
+  auto BaseAlignment = MaxAlignment;
+  while (reinterpret_cast<uintptr_t>(HstPtrBase) % BaseAlignment)
+    BaseAlignment /= 2;
----------------
jhuber6 wrote:
> Shouldn't this just be looking for the first non zero bit? Like `__builtin_ffsl` or similar?
That does seem like it would be more efficient.  I've not used it before, but it behaves in my CI.  Does the new code look reasonable to you?


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

https://reviews.llvm.org/D149490



More information about the Openmp-commits mailing list