From f1b8fa55d03315744a88035aa46fbbf9ec6ae622 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Sun, 25 Jul 2021 10:38:15 -0400 Subject: [PATCH] [OpenMP][NVPTX] Disable OpenMPOpt when building deviceRTLs We build `deviceRTLs` with `-O1` by default, which also triggers OpenMPOpt. When the info cache is created, some attributes are removed. As a result, although we mark a few functions `noinline`, they are still inlined when the bitcode library is generated. This can cause an issue in middle end optimization. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D106710 --- openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt index 2f16dbb3dd78..a07f4f7fa6ae 100644 --- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt +++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt @@ -153,7 +153,7 @@ set(cuda_src_files # Set flags for LLVM Bitcode compilation. set(bc_flags -S -x c++ -O1 -std=c++14 - -mllvm -openmp-opt-disable-internalization + -mllvm -openmp-opt-disable -target nvptx64 -Xclang -emit-llvm-bc -Xclang -aux-triple -Xclang ${aux_triple}