Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenMP] fix endianness dependent definitions in OMP headers for MSVC #84540

Merged
merged 5 commits into from
Mar 9, 2024

Conversation

vadikp-intel
Copy link
Contributor

MSVC does not define BYTE_ORDER making the check for BigEndian erroneously evaluate to true and breaking the struct definitions in MSVC compiled builds correspondingly. The fix adds an additional check for whether BYTE_ORDER is defined by the compiler to fix these.

@vadikp-intel vadikp-intel self-assigned this Mar 8, 2024
@llvmbot llvmbot added the openmp:libomp OpenMP host runtime label Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Contributor

@xingxue-ibm xingxue-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing the issue!

There are also 3 LIT test cases checking the same condition. It will be great if you could fix them while you are on it. Thanks!

openmp/runtime/test> grep -r __BYTE_ORDER__ *
tasking/bug_nested_proxy_task.c:#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
tasking/bug_proxy_task_dep_waiting.c:#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
tasking/hidden_helper_task/common.h:#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__

@vadikp-intel
Copy link
Contributor Author

added the test fixes

Copy link
Contributor

@xingxue-ibm xingxue-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm LGTM, thanks very much, @vadikp-intel!

@vadikp-intel vadikp-intel changed the title fix endianness dependent definitions in OMP headers for MSVC [OpenMP] fix endianness dependent definitions in OMP headers for MSVC Mar 8, 2024
@vadikp-intel vadikp-intel merged commit 110141b into main Mar 9, 2024
4 checks passed
@vadikp-intel vadikp-intel deleted the users/vadikp/MSVC.Endian.Fix.new branch March 9, 2024 18:47
llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Mar 10, 2024
…llvm#84540)

MSVC does not define __BYTE_ORDER__ making the check for BigEndian
erroneously evaluate to true and breaking the struct definitions in MSVC
compiled builds correspondingly. The fix adds an additional check for
whether __BYTE_ORDER__ is defined by the compiler to fix these.

---------

Co-authored-by: Vadim Paretsky <b-vadipa@microsoft.com>
(cherry picked from commit 110141b)
llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Mar 11, 2024
…llvm#84540)

MSVC does not define __BYTE_ORDER__ making the check for BigEndian
erroneously evaluate to true and breaking the struct definitions in MSVC
compiled builds correspondingly. The fix adds an additional check for
whether __BYTE_ORDER__ is defined by the compiler to fix these.

---------

Co-authored-by: Vadim Paretsky <b-vadipa@microsoft.com>
(cherry picked from commit 110141b)
@pointhex pointhex mentioned this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants