diff options
| author | Joseph Huber <jhuber6@vols.utk.edu> | 2022-07-27 11:04:25 -0400 |
|---|---|---|
| committer | Tom Stellard <tstellar@redhat.com> | 2022-07-29 22:12:16 -0700 |
| commit | fd8fd9e51cbeb76d290ceda941fd8b7d5a4151bc (patch) | |
| tree | 51c505e3fa5f087c741ed65a33b07f33ab078e06 /openmp/libomptarget/DeviceRTL/src/State.cpp | |
| parent | 5e4e8822c4c4fe568607b4168ed2cf4cf559b4e8 (diff) | |
Revert "[OpenMP] Remove noinline attributes in the device runtime"llvmorg-15.0.0-rc1
The behaviour of this patch is not great, but it has some side-effects
that are required for OpenMPOpt to work. The problem is that when we use
`-mlink-builtin-bitcode` we only import used symbols from the runtime.
Then OpenMPOpt will insert calls to symbols that were not previously
included. This patch removed this implicit behaviour as these functions
were kept alive by the `noinline` simply because it kept calls to them
in the module. This caused regression in some tests that relied on some
OpenMPOpt passes without using LTO. Reverting for the LLVM15 release but
will try to fix it more correctly on main.
This reverts commit d61d72dae604c3258e25c00622b1a85861450303.
Fixes #56752
(cherry picked from commit b08369f7f288b6efb0897953da42ed54e60cfc0b)
Diffstat (limited to 'openmp/libomptarget/DeviceRTL/src/State.cpp')
| -rw-r--r-- | openmp/libomptarget/DeviceRTL/src/State.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openmp/libomptarget/DeviceRTL/src/State.cpp b/openmp/libomptarget/DeviceRTL/src/State.cpp index 92847f79829d..7a73330aa4cc 100644 --- a/openmp/libomptarget/DeviceRTL/src/State.cpp +++ b/openmp/libomptarget/DeviceRTL/src/State.cpp @@ -393,12 +393,12 @@ int omp_get_initial_device(void) { return -1; } } extern "C" { -void *__kmpc_alloc_shared(uint64_t Bytes) { +__attribute__((noinline)) void *__kmpc_alloc_shared(uint64_t Bytes) { FunctionTracingRAII(); return memory::allocShared(Bytes, "Frontend alloc shared"); } -void __kmpc_free_shared(void *Ptr, uint64_t Bytes) { +__attribute__((noinline)) void __kmpc_free_shared(void *Ptr, uint64_t Bytes) { FunctionTracingRAII(); memory::freeShared(Ptr, Bytes, "Frontend free shared"); } |
