Revert "[CMake] Support a simple case for bootstrap builds to generate PGO data"
authorChris Bieneman <beanz@apple.com>
Sat, 19 Dec 2015 05:47:50 +0000 (05:47 +0000)
committerChris Bieneman <beanz@apple.com>
Sat, 19 Dec 2015 05:47:50 +0000 (05:47 +0000)
This reverts commit r256069, which was an unintentional tag along on
another commit.

llvm-svn: 256088

clang/CMakeLists.txt
clang/cmake/caches/PGO-stage2.cmake [deleted file]
clang/cmake/caches/PGO-stage3.cmake [deleted file]
clang/cmake/caches/PGO.cmake [deleted file]

index ad2ac42..2c54e75 100644 (file)
@@ -631,19 +631,11 @@ if (CLANG_ENABLE_BOOTSTRAP)
 
   string(REGEX MATCH "stage([0-9]*)" MATCHED_STAGE "${CLANG_STAGE}")
   if(MATCHED_STAGE)
-    if(NOT LLVM_BUILD_INSTRUMENTED)
-      math(EXPR STAGE_NUM "${CMAKE_MATCH_1} + 1")
-      set(NEXT_CLANG_STAGE stage${STAGE_NUM})
-    else()
-      set(NEXT_CLANG_STAGE stage${CMAKE_MATCH_1})
-    endif()
+    math(EXPR STAGE_NUM "${MATCHED_STAGE} + 1")
+    set(NEXT_CLANG_STAGE stage${STAGE_NUM})
   else()
     set(NEXT_CLANG_STAGE bootstrap)
   endif()
-
-  if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED)
-    set(NEXT_CLANG_STAGE ${NEXT_CLANG_STAGE}-instrumented)
-  endif()
   message(STATUS "Setting next clang stage to: ${NEXT_CLANG_STAGE}")
   
   
@@ -689,26 +681,6 @@ if (CLANG_ENABLE_BOOTSTRAP)
     set(RUNTIME_DEP compiler-rt)
   endif()
 
-  set(COMPILER_OPTIONS
-    -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++
-    -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
-    -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
-
-  if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED)
-    set(PGO_DEP llvm-profdata)
-    set(PGO_OPT -DLLVM_PROFDATA=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-profdata)
-  endif()
-
-  if(LLVM_BUILD_INSTRUMENTED)
-    set(PGO_DEP generate-profdata)
-    set(PGO_OPT -DLLVM_PROFDATA_FILE=${CMAKE_CURRENT_BINARY_DIR}/utils/perf-training/clang.profdata)
-    set(COMPILER_OPTIONS
-      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-      -DCMAKE_ASM_COMPILER=${CMAKE_ASM_COMPILER})
-    set(RUNTIME_DEP) # Don't set runtime dependencies
-  endif()
-
   # Find all variables that start with BOOTSTRAP_ and populate a variable with
   # them.
   get_cmake_property(variableNames VARIABLES)
@@ -731,7 +703,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
   endforeach()
 
   ExternalProject_Add(${NEXT_CLANG_STAGE}
-    DEPENDS clang ${LTO_DEP} ${RUNTIME_DEP} ${PGO_DEP}
+    DEPENDS clang ${LTO_DEP} ${RUNTIME_DEP}
     PREFIX ${NEXT_CLANG_STAGE}
     SOURCE_DIR ${CMAKE_SOURCE_DIR}
     STAMP_DIR ${STAMP_DIR}
@@ -743,9 +715,11 @@ if (CLANG_ENABLE_BOOTSTRAP)
                 -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
                 ${CLANG_BOOTSTRAP_CMAKE_ARGS}
                 ${PASSTHROUGH_VARIABLES}
-                 -DCLANG_STAGE=${NEXT_CLANG_STAGE}
-                ${COMPILER_OPTIONS}
-                ${LTO_LIBRARY} ${LTO_AR} ${LTO_RANLIB} ${verbose} ${PGO_OPT}
+                -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++
+                -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
+                -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
+                -DCLANG_STAGE=${NEXT_CLANG_STAGE}
+                ${LTO_LIBRARY} ${LTO_AR} ${LTO_RANLIB} ${verbose}
     INSTALL_COMMAND ""
     STEP_TARGETS configure build
     ${cmake_3_4_USES_TERMINAL_OPTIONS}
diff --git a/clang/cmake/caches/PGO-stage2.cmake b/clang/cmake/caches/PGO-stage2.cmake
deleted file mode 100644 (file)
index 332a1e1..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")
-set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
-set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")
-
-set(CLANG_BOOTSTRAP_TARGETS check-all check-llvm check-clang test-suite CACHE STRING "")
-
-set(CLANG_BOOTSTRAP_CMAKE_ARGS
-  -C ${CMAKE_CURRENT_LIST_DIR}/PGO-stage3.cmake
-  CACHE STRING "")
diff --git a/clang/cmake/caches/PGO-stage3.cmake b/clang/cmake/caches/PGO-stage3.cmake
deleted file mode 100644 (file)
index 2080cd4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")
-set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")
diff --git a/clang/cmake/caches/PGO.cmake b/clang/cmake/caches/PGO.cmake
deleted file mode 100644 (file)
index d97eeda..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")
-set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
-set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")
-
-set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "")
-set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")
-set(CLANG_BOOTSTRAP_TARGETS
-  generate-profdata
-  stage2
-  stage2-check-all
-  stage2-check-llvm
-  stage2-check-clang
-  stage2-test-suite CACHE STRING "")
-
-set(CLANG_BOOTSTRAP_CMAKE_ARGS
-  -C ${CMAKE_CURRENT_LIST_DIR}/PGO-stage2.cmake
-  CACHE STRING "")