[all-commits] [llvm/llvm-project] 89a807: [OpenMP][FIX] Properly align firstprivate variables

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Mon Feb 27 17:36:33 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89a8077f3d68f0f431f3657a8805f7751f5eac69
      https://github.com/llvm/llvm-project/commit/89a8077f3d68f0f431f3657a8805f7751f5eac69
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2023-02-27 (Mon, 27 Feb 2023)

  Changed paths:
    M openmp/libomptarget/src/omptarget.cpp
    A openmp/libomptarget/test/mapping/firstprivate_aligned.cpp

  Log Message:
  -----------
  [OpenMP][FIX] Properly align firstprivate variables

The old code didn't actually align the values, and it added padding even
when none was necessary. This approach will pad entries if necessary
and, similar to the struct case, use the host pointer as guidance.

NOTE: This does still not align them as the host has, but it's unclear
      if the user really should use the alignment bits anyway. For now
      this is a reasonable compromise, only if we have host alignment
      information (explicitly not implicitly via the host pointer), we
      could do it completely right without wasting lots of resources for
      >99% of the cases.

Fixes: https://github.com/llvm/llvm-project/issues/61034




More information about the All-commits mailing list