source: trunk/lib_ir/gen/CMakeLists.txt @ 4302

Last change on this file since 4302 was 4302, checked in by linmengl, 5 years ago

use template for 256-bit library test. Tested 256-bit long integer shift.

File size: 1.3 KB
Line 
1include_directories(${PROJECT_SOURCE_DIR})
2set(CMAKE_CXX_COMPILER "/usr/bin/g++")
3set(CMAKE_C_COMPILER "/usr/bin/gcc")
4
5add_executable(test_llc test_llc.cpp llc_func_optimized.o)
6
7if (USE_AVX2)
8add_executable(test_llc_256 test_llc_256.cpp llc_func_256_optimized.o)
9set_target_properties(test_llc_256
10  PROPERTIES
11  COMPILE_FLAGS "-DBLOCK_SIZE=256 -mavx2 -m64 -march=core-avx2 -fabi-version=6"
12  )
13
14add_custom_command(
15  OUTPUT llc_func_256_optimized.o llc_func_256_optimized.bc
16  COMMAND ${LLVM_OPT} -O3 -mattr=+avx2,+bmi2 llc_func_256.ll -o llc_func_256_optimized.bc
17  COMMAND ${LLVM_LLC} -O3 -mattr=+avx2,+bmi2 -filetype=obj llc_func_256_optimized.bc
18  DEPENDS llc_func_256.ll)
19
20add_test(
21  NAME ctest_llc_256
22  COMMAND ./test_llc_256)
23endif()
24
25add_custom_command(
26  OUTPUT llc_func_optimized.o llc_func_optimized.bc
27  COMMAND ${LLVM_OPT} -O3 ${LLVM_SSE_FLAGS} llc_func.ll -o llc_func_optimized.bc
28  COMMAND ${LLVM_LLC} -O3 ${LLVM_SSE_FLAGS} -filetype=obj llc_func_optimized.bc
29  DEPENDS llc_func.ll)
30
31add_custom_command(
32  OUTPUT llc_func.ll test_llc.cpp llc_func_256.ll test_llc_256.cpp
33  COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/gen.py
34  DEPENDS llc_func_256.pytemplate.ll llc_func.pytemplate.ll test_llc_256.pytemplate.cpp test_llc.pytemplate.cpp gen.py)
35
36add_test(
37  NAME ctest_llc
38  COMMAND ./test_llc)
Note: See TracBrowser for help on using the repository browser.