@@ -90,7 +90,7 @@ set(src_files
9090# propagation. That said, we will run the vectorizer again after the runtime
9191# has been linked into the user program.
9292set (clang_opt_flags -O3 -mllvm -openmp-opt-disable -DSHARED_SCRATCHPAD_SIZE=512 -mllvm -vectorize-slp=false )
93- set (link_opt_flags -O3 -openmp-opt-disable -attributor-enable=module -vectorize-slp=false )
93+ set (link_opt_flags -O3 -openmp-opt-disable -attributor-enable=module -vectorize-slp=false )
9494set (link_export_flag -passes=internalize -internalize-public -api-file=${source_directory} /exports)
9595
9696# If the user built with the GPU C library enabled we will use that instead.
@@ -103,11 +103,10 @@ set (LIBOMPTARGET_LLVM_INCLUDE_DIRS_DEVICERTL "${LIBOMPTARGET_LLVM_INCLUDE_DIRS}
103103list (TRANSFORM LIBOMPTARGET_LLVM_INCLUDE_DIRS_DEVICERTL PREPEND "-I" )
104104
105105# Set flags for LLVM Bitcode compilation.
106- set (bc_flags -c -foffload-lto -std=c++17 -fvisibility=hidden
107- ${clang_opt_flags} --offload-device-only
108- -nocudalib -nogpulib -nogpuinc
109- -fopenmp -fopenmp-cuda-mode
110- -Wno-unknown-cuda-version -Wno-openmp-target
106+ set (bc_flags -c -flto -std=c++17 -fvisibility=hidden
107+ ${clang_opt_flags} -nocudalib -nogpulib
108+ -nogpuinc -nostdlibinc -Wno-unknown-cuda-version
109+ -fno-rtti -fno-exceptions -fconvergent-functions
111110 -I${CMAKE_BINARY_DIR} /openmp/runtime/src # Need omp.h for LibM.
112111 -I${CMAKE_BINARY_DIR} /projects/openmp/runtime/src # Need omp.h for LibM.
113112 -I${CMAKE_BINARY_DIR} /runtime/src
@@ -139,9 +138,8 @@ function(compileDeviceRTLLibrary target_name target_triple)
139138 add_custom_target (${outfile}
140139 COMMAND ${CLANG_TOOL}
141140 ${bc_flags}
142- -fopenmp-targets=${target_triple}
143- -Xopenmp-target =${target_triple} -march=
144141 ${target_bc_flags}
142+ --target =${target_triple}
145143 -MD -MF ${depfile}
146144 ${infile} -o ${outfile}
147145 DEPENDS ${infile} ${include_files}
@@ -310,10 +308,7 @@ function(compileDeviceRTLLibrary target_name target_triple)
310308 set (ide_target_name omptarget-ide-${target_name} )
311309 add_library (${ide_target_name} STATIC EXCLUDE_FROM_ALL ${src_files} )
312310 target_compile_options (${ide_target_name} PRIVATE
313- -fopenmp -fopenmp-cuda-mode
314- -fopenmp-targets=${target_triple} -Xopenmp-target =${target_triple} -march=
315- -mllvm -openmp-opt-disable
316- -foffload-lto -fvisibility=hidden --offload-device-only
311+ --target =${target_triple} -flto -fvisibility=hidden
317312 -nocudalib -nogpulib -nogpuinc -nostdlibinc -Wno-unknown-cuda-version
318313 )
319314 target_compile_definitions (${ide_target_name} PRIVATE SHARED_SCRATCHPAD_SIZE=512)
0 commit comments