-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[OpenMP] Using SimpleVLA
to handle vla usage in ompt-general.cpp.
#114583
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
Conversation
@llvm/pr-subscribers-openmp Author: Daniel Chen (DanielCChen) ChangesThe
This patch is to ignore the checking against this usage. Full diff: https://github.com/llvm/llvm-project/pull/114583.diff 1 Files Affected:
diff --git a/openmp/runtime/src/ompt-general.cpp b/openmp/runtime/src/ompt-general.cpp
index 923eea2a563a91..c96bb3153b8a89 100644
--- a/openmp/runtime/src/ompt-general.cpp
+++ b/openmp/runtime/src/ompt-general.cpp
@@ -708,6 +708,9 @@ OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size,
return 0;
#else
int i, count;
+#ifdef __clang_major__ >= 18
+#pragma clang diagnostic ignored "-Wvla-cxx-extension"
+#endif
int tmp_ids[ids_size];
for (int j = 0; j < ids_size; j++)
tmp_ids[j] = 0;
|
I would prefer we remove the VLA access, but I don't know how difficult it is for this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is wrong. I previous added a VLA-equal template thing in libomp
and replaced all uses there. Can you move it somewhere common such that ompt can also use it?
Thanks for the pointer! @shiltian I replaced the offending code in
and it fixed the issue. Since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought ompt source file was in a separate directory. :-)
openmp/runtime/src/ompt-general.cpp
Outdated
@@ -23,6 +23,7 @@ | |||
#if KMP_OS_UNIX | |||
#include <dlfcn.h> | |||
#endif | |||
#include "kmp_utils.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put it in the right order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put it in the right order?
Could you please be more specific? @shiltian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielCChen, I think https://llvm.org/docs/CodingStandards.html#include-style says that this header should be moved up. Indeed, it wouldn't fit under the "system include files" comment.
I don't know what to say about the include of ompt-specific.cpp
(yes, .cpp
!) below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That is what I meant.
I don't know what to say about the include of ompt-specific.cpp (yes, .cpp!) below.
Me neither. ;-) That is before libomp
was contributed to LLVM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will move it before the system #include then.
SimpleVLA
to handle vla usage in ompt-general.cpp.
…lvm#114583) The `openmp` runtime failed to build on LoP with LLVM18 on LoP due to the addition of `-Wvla-cxx-extension` as ``` llvm-project/openmp/runtime/src/ompt-general.cpp:711:15: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 711 | int tmp_ids[ids_size]; | ^~~~~~~~ llvm-project/openmp/runtime/src/ompt-general.cpp:711:15: note: function parameter 'ids_size' with unknown value cannot be used in a constant expression llvm-project/openmp/runtime/src/ompt-general.cpp:704:65: note: declared here 704 | OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size, | ^ 1 error generated. ``` This patch is to ignore the checking against this usage.
The
openmp
runtime failed to build on LoP with LLVM18 on LoP due to the addition of-Wvla-cxx-extension
asThis patch is to ignore the checking against this usage.