This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] libomp: fix alignment issue in dist barrier on non-x86
Needs ReviewPublic

Authored by t-msn on Apr 6 2022, 2:18 AM.

Details

Summary

Following tsan warning appears on arm64 when using dist barrier:

1: ==603732==ERROR: ThreadSanitizer: invalid alignment requested in aligned_alloc: 1024,\
alignment must be a power of two and the requested size 0x900 must be a multiple of alignment

As the message says, roundup the size to be passed in alinged_alloc to fix this.

Diff Detail

Event Timeline

t-msn created this revision.Apr 6 2022, 2:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 2:18 AM
t-msn added a project: Restricted Project.
t-msn added a subscriber: openmp-commits.
t-msn published this revision for review.Apr 6 2022, 2:27 AM

I noticed this when running check-openmp with dist barrier by using https://reviews.llvm.org/D122645

Just a side note that dist barrier is an Intel-hardware-specific barrier. It's not likely to work well for non-Intel hardware.