4
4
5
5
# General Options
6
6
set (LLVM_RELEASE_ENABLE_LTO THIN CACHE STRING "" )
7
+ set (LLVM_RELEASE_ENABLE_PGO ON CACHE BOOL "" )
7
8
8
9
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING "" )
9
10
10
11
# Stage 1 Bootstrap Setup
11
12
set (CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "" )
12
- set (CLANG_BOOTSTRAP_TARGETS
13
- clang
14
- check-all
15
- check-llvm
16
- check-clang
17
- test -suite
18
- stage3
19
- stage3-clang
20
- stage3-check-all
21
- stage3-check-llvm
22
- stage3-check-clang
23
- stage3-install
24
- stage3-test-suite CACHE STRING "" )
13
+ if (LLVM_RELEASE_ENABLE_PGO )
14
+ set (CLANG_BOOTSTRAP_TARGETS
15
+ generate-profdata
16
+ stage2
17
+ stage2-clang
18
+ stage2-distribution
19
+ stage2-install
20
+ stage2-install-distribution
21
+ stage2-install-distribution-toolchain
22
+ stage2-check-all
23
+ stage2-check-llvm
24
+ stage2-check-clang
25
+ stage2-test-suite CACHE STRING "" )
26
+ else ()
27
+ set (CLANG_BOOTSTRAP_TARGETS
28
+ clang
29
+ check-all
30
+ check-llvm
31
+ check-clang
32
+ test -suite
33
+ stage3
34
+ stage3-clang
35
+ stage3-check-all
36
+ stage3-check-llvm
37
+ stage3-check-clang
38
+ stage3-install
39
+ stage3-test-suite CACHE STRING "" )
40
+ endif ()
41
+
42
+ if (LLVM_RELEASE_ENABLE_PGO )
43
+ list (INSERT CLANG_BOOTSTRAP_TARGETS 0 generate-profdata )
44
+ endif ()
25
45
26
46
# Stage 1 Options
27
- set (LLVM_ENABLE_PROJECTS "clang" CACHE STRING "" )
47
+ set (STAGE1_PROJECTS "clang" )
48
+ set (STAGE1_RUNTIMES "" )
49
+
50
+ if (LLVM_RELEASE_ENABLE_PGO )
51
+ list (APPEND STAGE1_PROJECTS "lld" )
52
+ list (APPEND STAGE1_RUNTIMES "compiler-rt" )
53
+ endif ()
54
+
55
+ set (LLVM_ENABLE_RUNTIMES ${STAGE1_RUNTIMES} CACHE STRING "" )
56
+ set (LLVM_ENABLE_PROJECTS ${STAGE1_PROJECTS} CACHE STRING "" )
57
+
28
58
set (LLVM_TARGETS_TO_BUILD Native CACHE STRING "" )
29
59
30
60
# Stage 2 Bootstrap Setup
@@ -37,11 +67,26 @@ set(BOOTSTRAP_CLANG_BOOTSTRAP_TARGETS
37
67
38
68
# Stage 2 Options
39
69
set (STAGE2_PROJECTS "clang" )
40
- if (LLVM_RELEASE_ENABLE_LTO )
70
+ set (STAGE2_RUNTIMES "" )
71
+
72
+ if (LLVM_RELEASE_ENABLE_LTO OR LLVM_RELEASE_ENABLE_PGO )
41
73
list (APPEND STAGE2_PROJECTS "lld" )
42
74
endif ()
75
+
76
+ if (LLVM_RELEASE_ENABLE_PGO )
77
+ set (BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "" )
78
+ list (APPEND STAGE2_RUTNIMES "compiler-rt" )
79
+ set (BOOTSTRAP_LLVM_ENABLE_LTO ${LLVM_RELEASE_ENABLE_LTO} )
80
+ if (LLVM_RELEASE_ENABLE_LTO )
81
+ set (BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "" )
82
+ endif ()
83
+ endif ()
84
+
43
85
set (BOOTSTRAP_LLVM_ENABLE_PROJECTS ${STAGE2_PROJECTS} CACHE STRING "" )
44
- set (BOOTSTRAP_LLVM_TARGETS_TO_BUILD Native CACHE STRING "" )
86
+ set (BOOTSTRAP_LLVM_ENABLE_RUNTIMES ${STAGE2_RUNTIMES} CACHE STRING "" )
87
+ if (NOT LLVM_RELEASE_PGO )
88
+ set (BOOTSTRAP_LLVM_TARGETS_TO_BUILD Native CACHE STRING "" )
89
+ endif ()
45
90
46
91
# Stage 3 Options
47
92
set (BOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "" )
0 commit comments