<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 17, 2015, at 11:37 AM, Justin Bogner <<a href="mailto:mail@justinbogner.com" class="">mail@justinbogner.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Chris Bieneman <</span><a href="mailto:beanz@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">beanz@apple.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> writes:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">beanz created this revision.<br class="">beanz added reviewers: bogner, silvas, chandlerc.<br class="">beanz added a subscriber: cfe-commits.<br class=""><br class="">This patch adds support for the clang multi-stage bootstrapping to<br class="">support PGO profdata generation, and can build a 2 or 3 stage<br class="">compiler.<br class=""><br class="">With this patch applied you can configure your build directory with<br class="">the following invocation of CMake:<br class=""><br class="">cmake -G <generator> -C <path_to_clang>/cmake/caches/PGO-stage1.cmake<br class=""><source dir><br class=""><br class="">After configuration the following additional targets will be generated:<br class=""><br class="">stage2:<br class="">Builds a stage1 x86 compiler, runtime, and required tools<br class="">(llvm-config, llvm-profdata) then uses that compiler to build an<br class="">instrumented stage2 compiler.<br class=""><br class="">stage2-generate-profdata:<br class="">Depends on "stage2" and will use the stage2 compiler to generate<br class="">profdata based on the training files in <clang>/utils/perf-training<br class=""><br class="">stage3:<br class="">Depends on "stage2-generate-profdata" and will use the stage1 compiler<br class="">with the stage2 profdata to build a PGO-optimized compiler.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Let's bikeshed a bit about terminology here.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This isn't really what "stage3" means in the typical sense - that term</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">is generally for a compiler built with a stage 2. What we're getting out</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">of this process is a PGO optimized compiler, but the result is actually</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">a stage 2 compiler. If we ever want to build another PGO'd compiler</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">using this one and do a binary compare, *that* would be stage 3.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">So if we want to use the "stage" terminology we have a stage1, a</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">training-stage2 and a optimized-stage2, or something like that. Those</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">are a little long though, so maybe it would make sense to just call</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">these stage1, training, and stage2. WDYT?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>How about stage2-instrumented and just stage2? Prefacing the instrumented with “stage2” lets us know what stage we’re on. That way it will continue to work if someone did either a stage1 or stage3 instrumented build.</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On a related note, the way these cache files are happening there are</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">sort of two kinds of them. The stage1 files are more-or-less user facing</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">and use the later stage cache files in their builds. Maybe we should</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">drop the stage1 from the user facing files and name them so that they</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">imply what the total result of the build will be (ie, it's just PGO).</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>I’ll make that change.</div><div><br class=""></div><div>I’m going to send out updated patches shortly caveat that I am sending them “untested”. The CMake configuration for stage1 works, and I expect it to fully work, but the many-stage builds take a long time.</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">stage3-check-llvm:<br class="">Depends on stage3 and runs check-llvm using the stage3 compiler.<br class=""><br class="">stage3-check-clang:<br class="">Depends on stage3 and runs check-clang using the stage3 compiler.<br class=""><br class="">stage3-check-all:<br class="">Depends on stage3 and runs check-all using the stage3 compiler.<br class=""><br class="">stage3-test-suite:<br class="">Depends on stage3 and runs the test-suite using the stage3 compiler<br class="">(requires in-tree test-suite).<br class=""><br class=""><a href="http://reviews.llvm.org/D15584" class="">http://reviews.llvm.org/D15584</a><br class=""><br class="">Files:<br class=""> CMakeLists.txt<br class=""> cmake/caches/PGO-stage1.cmake<br class=""> cmake/caches/PGO-stage2.cmake<br class=""> cmake/caches/PGO-stage3.cmake<br class=""><br class="">Index: cmake/caches/PGO-stage3.cmake<br class="">===================================================================<br class="">--- /dev/null<br class="">+++ cmake/caches/PGO-stage3.cmake<br class="">@@ -0,0 +1,2 @@<br class="">+set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")<br class="">+set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Does this actually use the generated profdata file? I can't find a place</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">where it does that.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div>This is actually setup in this diff in clang/CMakelists.txt. Look for PGO_OPT.</div><div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Index: cmake/caches/PGO-stage2.cmake<br class="">===================================================================<br class="">--- /dev/null<br class="">+++ cmake/caches/PGO-stage2.cmake<br class="">@@ -0,0 +1,9 @@<br class="">+set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")<br class="">+set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")<br class="">+set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")<br class="">+<br class="">+set(CLANG_BOOTSTRAP_TARGETS check-all check-llvm check-clang test-suite CACHE STRING "")<br class="">+<br class="">+set(CLANG_BOOTSTRAP_CMAKE_ARGS<br class="">+  -C ${CMAKE_CURRENT_LIST_DIR}/PGO-stage3.cmake<br class="">+  CACHE STRING "")<br class="">Index: cmake/caches/PGO-stage1.cmake<br class="">===================================================================<br class="">--- /dev/null<br class="">+++ cmake/caches/PGO-stage1.cmake<br class="">@@ -0,0 +1,17 @@<br class="">+set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")<br class="">+set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")<br class="">+set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")<br class="">+<br class="">+set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "")<br class="">+set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")<br class="">+set(CLANG_BOOTSTRAP_TARGETS<br class="">+  stage3<br class="">+  generate-profdata<br class="">+  stage3-check-all<br class="">+  stage3-check-llvm<br class="">+  stage3-check-clang<br class="">+  stage3-test-suite CACHE STRING "")<br class="">+<br class="">+set(CLANG_BOOTSTRAP_CMAKE_ARGS<br class="">+  -C ${CMAKE_CURRENT_LIST_DIR}/PGO-stage2.cmake<br class="">+  CACHE STRING "")<br class="">Index: CMakeLists.txt<br class="">===================================================================<br class="">--- CMakeLists.txt<br class="">+++ CMakeLists.txt<br class="">@@ -677,6 +677,25 @@<br class="">    CLANG_REPOSITORY_STRING<br class="">    CMAKE_MAKE_PROGRAM)<br class=""><br class="">+  set(COMPILER_OPTIONS<br class="">+    -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++<br class="">+    -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang<br class="">+    -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)<br class="">+<br class="">+  if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED)<br class="">+    set(PGO_DEP llvm-profdata)<br class="">+    set(PGO_OPT -DLLVM_PROFDATA=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-profdata)<br class="">+  endif()<br class="">+<br class="">+  if(LLVM_BUILD_INSTRUMENTED)<br class="">+    set(PGO_DEP generate-profdata)<br class="">+    set(PGO_OPT -DLLVM_PROFDATA_FILE=${CMAKE_CURRENT_BINARY_DIR}/utils/perf-training/clang.profdata)<br class="">+    set(COMPILER_OPTIONS<br class="">+      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}<br class="">+      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}<br class="">+      -DCMAKE_ASM_COMPILER=${CMAKE_ASM_COMPILER})<br class="">+  endif()<br class="">+  <br class="">  if(TARGET compiler-rt)<br class="">    set(RUNTIME_DEP compiler-rt)<br class="">  endif()<br class="">@@ -703,7 +722,7 @@<br class="">  endforeach()<br class=""><br class="">  ExternalProject_Add(${NEXT_CLANG_STAGE}<br class="">-    DEPENDS clang ${LTO_DEP} ${RUNTIME_DEP}<br class="">+    DEPENDS clang ${LTO_DEP} ${RUNTIME_DEP} ${PGO_DEP}<br class="">    PREFIX ${NEXT_CLANG_STAGE}<br class="">    SOURCE_DIR ${CMAKE_SOURCE_DIR}<br class="">    STAMP_DIR ${STAMP_DIR}<br class="">@@ -715,11 +734,9 @@<br class="">                -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}<br class="">                ${CLANG_BOOTSTRAP_CMAKE_ARGS}<br class="">                ${PASSTHROUGH_VARIABLES}<br class="">-                -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++<br class="">-                -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang<br class="">-                -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang<br class="">-                -DCLANG_STAGE=${NEXT_CLANG_STAGE}<br class="">-                ${LTO_LIBRARY} ${LTO_AR} ${LTO_RANLIB} ${verbose}<br class="">+                 -DCLANG_STAGE=${NEXT_CLANG_STAGE}<br class="">+                ${COMPILER_OPTIONS}<br class="">+                ${LTO_LIBRARY} ${LTO_AR} ${LTO_RANLIB} ${verbose} ${PGO_OPT}<br class="">    INSTALL_COMMAND ""<br class="">    STEP_TARGETS configure build<br class="">    ${cmake_3_4_USES_TERMINAL_OPTIONS}<br class=""><br class=""><br class="">Index: cmake/caches/PGO-stage3.cmake<br class="">===================================================================<br class="">--- /dev/null<br class="">+++ cmake/caches/PGO-stage3.cmake<br class="">@@ -0,0 +1,2 @@<br class="">+set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")<br class="">+set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")<br class="">Index: cmake/caches/PGO-stage2.cmake<br class="">===================================================================<br class="">--- /dev/null<br class="">+++ cmake/caches/PGO-stage2.cmake<br class="">@@ -0,0 +1,9 @@<br class="">+set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")<br class="">+set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")<br class="">+set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")<br class="">+<br class="">+set(CLANG_BOOTSTRAP_TARGETS check-all check-llvm check-clang test-suite CACHE STRING "")<br class="">+<br class="">+set(CLANG_BOOTSTRAP_CMAKE_ARGS<br class="">+  -C ${CMAKE_CURRENT_LIST_DIR}/PGO-stage3.cmake<br class="">+  CACHE STRING "")<br class="">Index: cmake/caches/PGO-stage1.cmake<br class="">===================================================================<br class="">--- /dev/null<br class="">+++ cmake/caches/PGO-stage1.cmake<br class="">@@ -0,0 +1,17 @@<br class="">+set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "")<br class="">+set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")<br class="">+set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "")<br class="">+<br class="">+set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "")<br class="">+set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")<br class="">+set(CLANG_BOOTSTRAP_TARGETS<br class="">+  stage3<br class="">+  generate-profdata<br class="">+  stage3-check-all<br class="">+  stage3-check-llvm<br class="">+  stage3-check-clang<br class="">+  stage3-test-suite CACHE STRING "")<br class="">+<br class="">+set(CLANG_BOOTSTRAP_CMAKE_ARGS<br class="">+  -C ${CMAKE_CURRENT_LIST_DIR}/PGO-stage2.cmake<br class="">+  CACHE STRING "")<br class="">Index: CMakeLists.txt<br class="">===================================================================<br class="">--- CMakeLists.txt<br class="">+++ CMakeLists.txt<br class="">@@ -677,6 +677,25 @@<br class="">    CLANG_REPOSITORY_STRING<br class="">    CMAKE_MAKE_PROGRAM)<br class=""><br class="">+  set(COMPILER_OPTIONS<br class="">+    -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++<br class="">+    -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang<br class="">+    -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)<br class="">+<br class="">+  if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED)<br class="">+    set(PGO_DEP llvm-profdata)<br class="">+    set(PGO_OPT -DLLVM_PROFDATA=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-profdata)<br class="">+  endif()<br class="">+<br class="">+  if(LLVM_BUILD_INSTRUMENTED)<br class="">+    set(PGO_DEP generate-profdata)<br class="">+    set(PGO_OPT -DLLVM_PROFDATA_FILE=${CMAKE_CURRENT_BINARY_DIR}/utils/perf-training/clang.profdata)<br class="">+    set(COMPILER_OPTIONS<br class="">+      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}<br class="">+      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}<br class="">+      -DCMAKE_ASM_COMPILER=${CMAKE_ASM_COMPILER})<br class="">+  endif()<br class="">+  <br class="">  if(TARGET compiler-rt)<br class="">    set(RUNTIME_DEP compiler-rt)<br class="">  endif()<br class="">@@ -703,7 +722,7 @@<br class="">  endforeach()<br class=""><br class="">  ExternalProject_Add(${NEXT_CLANG_STAGE}<br class="">-    DEPENDS clang ${LTO_DEP} ${RUNTIME_DEP}<br class="">+    DEPENDS clang ${LTO_DEP} ${RUNTIME_DEP} ${PGO_DEP}<br class="">    PREFIX ${NEXT_CLANG_STAGE}<br class="">    SOURCE_DIR ${CMAKE_SOURCE_DIR}<br class="">    STAMP_DIR ${STAMP_DIR}<br class="">@@ -715,11 +734,9 @@<br class="">                -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}<br class="">                ${CLANG_BOOTSTRAP_CMAKE_ARGS}<br class="">                ${PASSTHROUGH_VARIABLES}<br class="">-                -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++<br class="">-                -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang<br class="">-                -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang<br class="">-                -DCLANG_STAGE=${NEXT_CLANG_STAGE}<br class="">-                ${LTO_LIBRARY} ${LTO_AR} ${LTO_RANLIB} ${verbose}<br class="">+                 -DCLANG_STAGE=${NEXT_CLANG_STAGE}<br class="">+                ${COMPILER_OPTIONS}<br class="">+                ${LTO_LIBRARY} ${LTO_AR} ${LTO_RANLIB} ${verbose} ${PGO_OPT}<br class="">    INSTALL_COMMAND ""<br class="">    STEP_TARGETS configure build<br class="">    ${cmake_3_4_USES_TERMINAL_OPTIONS}</blockquote></div></blockquote></div><br class=""></body></html>