Ignore:
Timestamp:
Aug 19, 2014, 8:09:59 PM (5 years ago)
Author:
linmengl
Message:

add p2s.ll file, p2s_step works now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib_ir/CMakeLists.txt

    r4044 r4050  
    1818set(CMAKE_CXX_FLAGS "${CXX_SSE_FLAGS} -std=c++11 ")
    1919
     20set(LL_SOURCE_FILES s2p.ll p2s.ll)
     21if (USE_AVX2)
     22  #append s2p_ideal.ll to source list
     23  set(LL_SOURCE_FILES {LL_SOURCE_FILES} s2p_ideal.ll)
     24endif (USE_AVX2)
     25
    2026set(LLVM_OPT "opt-svn")
    2127set(LLVM_LLC "llc-svn")
     28set(LLVM_LINK "llvm-link")
    2229
    23 set(LLVM_LLC_FLAGS )#-x86-experimental-vector-shuffle-lowering)
    24 
    25 add_executable(test_s2p test_s2p.cpp s2p_optimized.o)
    26 add_executable(test_link test_link.cpp s2p_optimized.o)
    27 add_executable(test_pack test_pack.cpp s2p_optimized.o)
     30add_executable(test_s2p test_s2p.cpp ir_impl.o)
     31add_executable(test_link test_link.cpp ir_impl.o)
     32add_executable(test_pack test_pack.cpp ir_impl.o)
    2833
    2934# gen/ is used to test llc backend.
     
    3237# test packh_2,4,8 only on avx2
    3338if (USE_AVX2)
    34     add_executable(test_pack_avx2 test_pack_avx2.cpp s2p_optimized.o)
     39    add_executable(test_pack_avx2 test_pack_avx2.cpp ir_impl.o)
    3540    add_test(
    3641      NAME ctest_pack_avx2
     
    3944
    4045include_directories("xmlwf/util" "xmlwf/lib")
    41 add_executable(xmlwf xmlwf/src/xmlwf.cpp s2p_optimized.o)
     46add_executable(xmlwf xmlwf/src/xmlwf.cpp ir_impl.o)
    4247
    4348# xmlwf_perf compiles with additional flags and is only used for the perf_xmlwf
    4449# targets below.
    45 add_executable(xmlwf_perf xmlwf/src/xmlwf.cpp s2p_optimized.o)
     50add_executable(xmlwf_perf xmlwf/src/xmlwf.cpp ir_impl.o)
    4651set_target_properties(xmlwf_perf
    4752  PROPERTIES
     
    4954  )
    5055
    51 add_executable(u8u16 u8u16/src/u8u16.cpp s2p_optimized.o)
     56add_executable(u8u16 u8u16/src/u8u16.cpp ir_impl.o)
    5257
    53 add_custom_target(asm_s2p
    54   COMMAND ${LLVM_LLC} -O3 ${LLVM_SSE_FLAGS} s2p_optimized.bc
    55   DEPENDS s2p_optimized.bc)
     58add_custom_target(asm
     59  COMMAND ${LLVM_LLC} -O3 ${LLVM_SSE_FLAGS} ir_impl_opt.bc
     60  DEPENDS ir_impl_opt.bc)
    5661
    57 # a little bit tricky here, on USE_AVX2, we need to append s2p_ideal.ll to s2p.ll
    58 # in order to have function s2p_ideal
    59 if (USE_AVX2)
    60   message("---- Concat s2p.ll with s2p_ideal.ll")
    61   add_custom_command(
    62     OUTPUT s2p.ll
    63     COMMAND cp ${PROJECT_SOURCE_DIR}/s2p.ll .
    64     COMMAND cat ${PROJECT_SOURCE_DIR}/s2p_ideal.ll >> s2p.ll
    65     DEPENDS ${PROJECT_SOURCE_DIR}/s2p.ll ${PROJECT_SOURCE_DIR}/s2p_ideal.ll)
     62# link ll source files together into ir_impl.bc
     63message("---- Link ${LL_SOURCE_FILES} ----")
     64add_custom_command(
     65  OUTPUT  ir_impl.bc
     66  COMMAND ${LLVM_LINK} ${LL_SOURCE_FILES} -o ${CMAKE_BINARY_DIR}/ir_impl.bc
     67  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     68  DEPENDS ${LL_SOURCE_FILES})
    6669
    67 else (USE_AVX2)
    68   add_custom_command(
    69     OUTPUT s2p.ll
    70     COMMAND cp ${PROJECT_SOURCE_DIR}/s2p.ll .
    71     DEPENDS ${PROJECT_SOURCE_DIR}/s2p.ll)
    72 
    73 endif (USE_AVX2)
    74 
    75 # compile s2p.ll, and make sure test_s2p depends on it.
     70# compile ir_impl.bc
    7671add_custom_command(
    77   OUTPUT  s2p_optimized.o s2p_optimized.bc
    78   COMMAND ${LLVM_OPT} -O3 -std-compile-opts ${LLVM_SSE_FLAGS} s2p.ll -o s2p_optimized.bc
    79   COMMAND ${LLVM_LLC} -O3 ${LLVM_SSE_FLAGS} -filetype=obj s2p_optimized.bc
    80   DEPENDS s2p.ll)
     72  OUTPUT  ir_impl.o ir_impl_opt.bc
     73  COMMAND ${LLVM_OPT} -O3 -std-compile-opts ${LLVM_SSE_FLAGS} ir_impl.bc -o ir_impl_opt.bc
     74  COMMAND ${LLVM_LLC} -O3 ${LLVM_SSE_FLAGS} -filetype=obj ir_impl_opt.bc -o ir_impl.o
     75  DEPENDS ir_impl.bc)
    8176
    8277add_test(
     
    10095  COMMAND ${CMAKE_CTEST_COMMAND}
    10196  DEPENDS test_s2p test_link test_pack test_llc xmlwf u8u16)
    102 
    10397
    10498# `make check` also depends on test_pack_avx2
Note: See TracChangeset for help on using the changeset viewer.