diff --git a/openmp/libomptarget/DeviceRTL/src/Utils.cpp b/openmp/libomptarget/DeviceRTL/src/Utils.cpp --- a/openmp/libomptarget/DeviceRTL/src/Utils.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Utils.cpp @@ -21,7 +21,7 @@ namespace _OMP { /// Helper to keep code alive without introducing a performance penalty. -__attribute__((used, retain, weak, optnone)) void keepAlive() { +__attribute__((used, retain, weak, optnone, cold)) void keepAlive() { __kmpc_get_hardware_thread_id_in_block(); __kmpc_get_hardware_num_threads_in_block(); __kmpc_get_warp_size(); diff --git a/openmp/libomptarget/deviceRTLs/common/src/support.cu b/openmp/libomptarget/deviceRTLs/common/src/support.cu --- a/openmp/libomptarget/deviceRTLs/common/src/support.cu +++ b/openmp/libomptarget/deviceRTLs/common/src/support.cu @@ -228,7 +228,7 @@ namespace _OMP { /// Helper to keep code alive without introducing a performance penalty. -__attribute__((used, retain, weak, optnone)) void keepAlive() { +__attribute__((used, retain, weak, optnone, cold)) void keepAlive() { __kmpc_get_hardware_thread_id_in_block(); __kmpc_get_hardware_num_threads_in_block(); __kmpc_get_warp_size();