Revert "[OpenMP] Remove noinline attributes in the device runtime"
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 27 Jul 2022 15:04:25 +0000 (11:04 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 27 Jul 2022 15:09:18 +0000 (11:09 -0400)
commitb08369f7f288b6efb0897953da42ed54e60cfc0b
treeb2940eb46bee866b9f4b0d4e2b7b7f60e5c5ecdb
parenta8fdc247e90da110c2f71c5c0075e537af2b0111
Revert "[OpenMP] Remove noinline attributes in the device runtime"

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
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/Transforms/OpenMP/remove_noinline_attributes.ll [new file with mode: 0644]
openmp/libomptarget/DeviceRTL/include/Synchronization.h
openmp/libomptarget/DeviceRTL/src/Mapping.cpp
openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
openmp/libomptarget/DeviceRTL/src/State.cpp
openmp/libomptarget/DeviceRTL/src/Synchronization.cpp