[PATCH] D23127: [test-suite] Bitcode tests: Update cmake to build driver and halide runtime only once.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 11:30:50 PDT 2016


asbirlea created this revision.
asbirlea added reviewers: mehdi_amini, MatzeB.
asbirlea added a subscriber: llvm-commits.

The simd_ops bitcode tests used to build the common driver and the halide runtime for each test.
Update cmake so they are build just once.
Note that in the future the halide runtime could be taken up one directory level and used in common for
multiple tests and benchmark. However building just the one .bc file into a static library failed on OSX.

https://reviews.llvm.org/D23127

Files:
  Bitcode/simd_ops/CMakeLists.txt

Index: Bitcode/simd_ops/CMakeLists.txt
===================================================================
--- Bitcode/simd_ops/CMakeLists.txt
+++ Bitcode/simd_ops/CMakeLists.txt
@@ -6,14 +6,22 @@
 SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/simd_op_check_runtime.bc PROPERTIES LANGUAGE CXX)
 
 list(APPEND LDFLAGS -lpthread -ldl)
+add_library(simd_ops STATIC ${CMAKE_CURRENT_SOURCE_DIR}/simd_ops.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}_halide_runtime.bc)
+target_link_libraries(simd_ops)
+if (NOT TEST_SUITE_USE_PERF)
+  add_dependencies(simd_ops timeit-target)
+endif()
+add_dependencies(simd_ops timeit-host fpcmp-host)
+set_target_properties(simd_ops PROPERTIES LINKER_LANGUAGE CXX)
 
 foreach(sourcebc ${uosources})
   string(REGEX REPLACE ".[cp]+$" "" pathbc ${sourcebc})
   string(REGEX REPLACE ".*/" "" namebc ${pathbc})
   string(REPLACE "." "" namebc ${namebc})
-  set(Source ${CMAKE_CURRENT_SOURCE_DIR}/simd_ops.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}_halide_runtime.bc ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}_tests/${namebc}.bc ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}_scalar_tests/scalar_${namebc}.bc)
+  set(Source ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}_halide_runtime.bc ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}_tests/${namebc}.bc ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}_scalar_tests/scalar_${namebc}.bc)
   set(PROG simd_ops_${namebc})
   llvm_multisource()
+  target_link_libraries(${PROG} simd_ops)
 endforeach()
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23127.66684.patch
Type: text/x-patch
Size: 1426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160803/a046155b/attachment.bin>


More information about the llvm-commits mailing list