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 ()
25
41
26
42
# Stage 1 Options
27
- set (LLVM_ENABLE_PROJECTS "clang" CACHE STRING "" )
43
+ set (STAGE1_PROJECTS "clang" )
44
+ set (STAGE1_RUNTIMES "" )
45
+
46
+ if (LLVM_RELEASE_ENABLE_PGO )
47
+ list (APPEND STAGE1_PROJECTS "lld" )
48
+ list (APPEND STAGE1_RUNTIMES "compiler-rt" )
49
+ endif ()
50
+
51
+ set (LLVM_ENABLE_RUNTIMES ${STAGE1_RUNTIMES} CACHE STRING "" )
52
+ set (LLVM_ENABLE_PROJECTS ${STAGE1_PROJECTS} CACHE STRING "" )
53
+
28
54
set (LLVM_TARGETS_TO_BUILD Native CACHE STRING "" )
29
55
30
56
# Stage 2 Bootstrap Setup
@@ -37,11 +63,26 @@ set(BOOTSTRAP_CLANG_BOOTSTRAP_TARGETS
37
63
38
64
# Stage 2 Options
39
65
set (STAGE2_PROJECTS "clang" )
40
- if (LLVM_RELEASE_ENABLE_LTO )
66
+ set (STAGE2_RUNTIMES "" )
67
+
68
+ if (LLVM_RELEASE_ENABLE_LTO OR LLVM_RELEASE_ENABLE_PGO )
41
69
list (APPEND STAGE2_PROJECTS "lld" )
42
70
endif ()
71
+
72
+ if (LLVM_RELEASE_ENABLE_PGO )
73
+ set (BOOTSTRAP_LLVM_BUILD_INSTRUMENTED IR CACHE STRING "" )
74
+ list (APPEND STAGE2_RUNTIMES "compiler-rt" )
75
+ set (BOOTSTRAP_LLVM_ENABLE_LTO ${LLVM_RELEASE_ENABLE_LTO} )
76
+ if (LLVM_RELEASE_ENABLE_LTO )
77
+ set (BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "" )
78
+ endif ()
79
+ endif ()
80
+
43
81
set (BOOTSTRAP_LLVM_ENABLE_PROJECTS ${STAGE2_PROJECTS} CACHE STRING "" )
44
- set (BOOTSTRAP_LLVM_TARGETS_TO_BUILD Native CACHE STRING "" )
82
+ set (BOOTSTRAP_LLVM_ENABLE_RUNTIMES ${STAGE2_RUNTIMES} CACHE STRING "" )
83
+ if (NOT LLVM_RELEASE_ENABLE_PGO )
84
+ set (BOOTSTRAP_LLVM_TARGETS_TO_BUILD Native CACHE STRING "" )
85
+ endif ()
45
86
46
87
# Stage 3 Options
47
88
set (BOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "" )
0 commit comments