Skip to content

Commit d5aa29c

Browse files
committed
Merging r325218:
------------------------------------------------------------------------ r325218 | hahnfeld | 2018-02-15 09:10:22 +0100 (Thu, 15 Feb 2018) | 10 lines [CMake] Add -fno-experimental-isel for testing GlobalISel doesn't yet implement blockaddress and falls back to SelectionDAG. This results in additional branch instruction to the next basic block which breaks the OMPT tests. Disable GlobalISel for now when compiling the tests because fixing them is not easily possible. See http://llvm.org/PR36313 for full discussion history. Differential Revision: https://reviews.llvm.org/D43195 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_60@325230 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 3d85b5b commit d5aa29c

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Diff for: cmake/DetectTestCompiler/CMakeLists.txt

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
cmake_minimum_required(VERSION 2.8)
22
project(DetectTestCompiler C CXX)
33

4+
include(CheckCCompilerFlag)
5+
include(CheckCXXCompilerFlag)
6+
47
function(write_compiler_information lang)
58
set(information "${CMAKE_${lang}_COMPILER}")
69
set(information "${information}\\;${CMAKE_${lang}_COMPILER_ID}")
710
set(information "${information}\\;${CMAKE_${lang}_COMPILER_VERSION}")
8-
set(information "${information}\\;${OpenMP_${lang}_FLAGS}")
11+
set(information "${information}\\;${${lang}_FLAGS}")
912
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${lang}CompilerInformation.txt ${information})
1013
endfunction(write_compiler_information)
1114

@@ -15,5 +18,22 @@ if (NOT OpenMP_Found)
1518
set(OpenMP_CXX_FLAGS "-fopenmp")
1619
endif()
1720

21+
set(C_FLAGS ${flags} ${OpenMP_C_FLAGS})
22+
set(CXX_FLAGS ${flags} ${OpenMP_CXX_FLAGS})
23+
24+
# TODO: Implement blockaddress in GlobalISel and remove this flag!
25+
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
26+
check_c_compiler_flag("-fno-experimental-isel" C_HAS_EXPERIMENTAL_ISEL_FLAG)
27+
check_cxx_compiler_flag("-fno-experimental-isel" CXX_HAS_EXPERIMENTAL_ISEL_FLAG)
28+
macro(add_experimental_isel_flag lang)
29+
if (${lang}_HAS_EXPERIMENTAL_ISEL_FLAG)
30+
set(${lang}_FLAGS "-fno-experimental-isel ${${lang}_FLAGS}")
31+
endif()
32+
endmacro(add_experimental_isel_flag)
33+
34+
add_experimental_isel_flag(C)
35+
add_experimental_isel_flag(CXX)
36+
endif()
37+
1838
write_compiler_information(C)
1939
write_compiler_information(CXX)

Diff for: cmake/OpenMPTesting.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ else()
117117
# Cannot use CLANG_VERSION because we are not guaranteed that this is already set.
118118
set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}")
119119
set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_MAJOR_VERSION}")
120-
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp")
120+
# TODO: Implement blockaddress in GlobalISel and remove this flag!
121+
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp -fno-experimental-isel")
121122
endif()
122123

123124
# Function to set compiler features for use in lit.

0 commit comments

Comments
 (0)