[PATCH] D88441: [OpenMPOpt][Fix] Only initialize ICV initial values once.
Stefan Stipanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 28 12:39:21 PDT 2020
sstefan1 created this revision.
sstefan1 added reviewers: jdoerfert, ggeorgakoudis.
Herald added subscribers: llvm-commits, guansong, yaxunl.
Herald added a project: LLVM.
sstefan1 requested review of this revision.
This is mostly taken from D85703 <https://reviews.llvm.org/D85703> and should go in separately.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D88441
Files:
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
Index: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
===================================================================
--- llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
+++ llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
@@ -228,6 +228,20 @@
///
///{
+#ifndef ICV_INIT_VALUE
+#define ICV_INIT_VALUE(Enum, Name)
+#endif
+
+#define __ICV_INIT_VALUE(Name) ICV_INIT_VALUE(ICV_##Name, #Name)
+
+__ICV_INIT_VALUE(ZERO)
+__ICV_INIT_VALUE(FALSE)
+__ICV_INIT_VALUE(IMPLEMENTATION_DEFINED)
+__ICV_INIT_VALUE(LAST)
+
+#undef __ICV_INIT_VALUE
+#undef ICV_INIT_VALUE
+
#ifndef ICV_DATA_ENV
#define ICV_DATA_ENV(Enum, Name, EnvVarName, Init)
#endif
@@ -238,6 +252,7 @@
__ICV_DATA_ENV(nthreads, OMP_NUM_THREADS, ICV_IMPLEMENTATION_DEFINED)
__ICV_DATA_ENV(active_levels, NONE, ICV_ZERO)
__ICV_DATA_ENV(cancel, OMP_CANCELLATION, ICV_FALSE)
+__ICV_DATA_ENV(proc_bind, OMP_PROC_BIND, ICV_IMPLEMENTATION_DEFINED)
__ICV_DATA_ENV(__last, last, ICV_LAST)
#undef __ICV_DATA_ENV
Index: llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
===================================================================
--- llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
+++ llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
@@ -41,12 +41,12 @@
#include "llvm/Frontend/OpenMP/OMPKinds.def"
enum class ICVInitValue {
-#define ICV_DATA_ENV(Enum, Name, EnvVar, Init) Init,
+#define ICV_INIT_VALUE(Enum, Name) Enum,
#include "llvm/Frontend/OpenMP/OMPKinds.def"
};
-#define ICV_DATA_ENV(Enum, Name, EnvVar, Init) \
- constexpr auto Init = omp::ICVInitValue::Init;
+#define ICV_INIT_VALUE(Enum, Name) \
+ constexpr auto Enum = omp::ICVInitValue::Enum;
#include "llvm/Frontend/OpenMP/OMPKinds.def"
/// IDs for all omp runtime library (RTL) functions.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88441.294782.patch
Type: text/x-patch
Size: 1810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200928/b1d917ac/attachment.bin>
More information about the llvm-commits
mailing list