[Openmp-commits] [PATCH] D142508: [OpenMP][libomptarget] Fix alignment calculation for mapping struct members.

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 24 15:37:56 PST 2023


jdoerfert added a comment.

I'm not sure I understand the logic between the subtraction here. Instead, I would suggest we adjust the effective alignment used as follows:

  int64_t EffectiveAlignment = (int64_t)HstPtrBase % Alignment;

Which should give us the minimum of the two alignments (8 byte and base object alignment), right?
If so, that is what we should be using for the object. So, replace `Alignment` use with `EffectiveAlignment` which should shrink Padding in your use case to 0.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142508



More information about the Openmp-commits mailing list