@@ -121,6 +121,45 @@ jobs:
121121 release_binary_basename="LLVM-$release_version-$RUNNER_OS-$RUNNER_ARCH"
122122 echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT
123123 echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT
124+ enable_pgo=1
125+
126+ case "${{ inputs.runs-on }}" in
127+ ubuntu-22.04*)
128+ build_runs_on="depot-${{ inputs.runs-on }}-16"
129+ test_runs_on=$build_runs_on
130+ ;;
131+ macos-13)
132+ if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
133+ build_runs_on="${{ inputs.runs-on }}"
134+ enable_pgo=0
135+ target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
136+ else
137+ build_runs_on="macos-13-large"
138+ fi
139+ test_runs_on="${{ inputs.runs-on }}"
140+ ;;
141+ macos-14)
142+ if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
143+ build_runs_on="${{ inputs.runs-on }}"
144+ enable_pgo=0
145+ target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
146+ else
147+ build_runs_on="depot-macos-14"
148+ fi
149+ test_runs_on="${{ inputs.runs-on }}"
150+ ;;
151+ *)
152+ test_runs_on="${{ inputs.runs-on }}"
153+ build_runs_on=$test_runs_on
154+ ;;
155+ esac
156+
157+ if [ "$enable_pgo" -eq 1 ]; then
158+ bootstrap_prefix="BOOTSTRAP_BOOTSTRAP"
159+ else
160+ bootstrap_prefix="BOOTSTRAP"
161+ target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PGO=OFF"
162+ fi
124163
125164 target="$RUNNER_OS-$RUNNER_ARCH"
126165 # The hendrikmuhs/ccache-action action does not support installing sccache
@@ -135,7 +174,7 @@ jobs:
135174 # add extra CMake args to disable them.
136175 # See https://github.com/llvm/llvm-project/issues/99767
137176 if [ "$RUNNER_OS" = "macOS" ]; then
138- target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_COMPILER_RT_ENABLE_IOS =OFF"
177+ target_cmake_flags="$target_cmake_flags -D${bootstrap_prefix}_COMPILER_RT_ENABLE_IOS =OFF"
139178 if [ "$RUNNER_ARCH" = "ARM64" ]; then
140179 arches=arm64
141180 else
@@ -146,7 +185,7 @@ jobs:
146185 # so we need to disable flang there.
147186 target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PROJECTS='clang;lld;lldb;clang-tools-extra;polly;mlir'"
148187 fi
149- target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_ARCHS =$arches -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS =$arches"
188+ target_cmake_flags="$target_cmake_flags -D${bootstrap_prefix}_DARWIN_osx_ARCHS =$arches -D${bootstrap_prefix}_DARWIN_osx_BUILTIN_ARCHS =$arches"
150189 fi
151190
152191 build_flang="true"
@@ -155,35 +194,9 @@ jobs:
155194 # The build times out on Windows, so we need to disable LTO.
156195 target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
157196 fi
197+
198+ target_cmake_flags=$target_cmake_flags -D${bootstrap_prefix}_CPACK_PACKAGE_FILE_NAME=$release_binary_basename
158199
159- case "${{ inputs.runs-on }}" in
160- ubuntu-22.04*)
161- build_runs_on="depot-${{ inputs.runs-on }}-16"
162- test_runs_on=$build_runs_on
163- ;;
164- macos-13)
165- if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
166- build_runs_on="${{ inputs.runs-on }}"
167- target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF -DLLVM_RELEASE_ENABLE_PGO=OFF"
168- else
169- build_runs_on="macos-13-large"
170- fi
171- test_runs_on="${{ inputs.runs-on }}"
172- ;;
173- macos-14)
174- if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
175- build_runs_on="${{ inputs.runs-on }}"
176- target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF -DLLVM_RELEASE_ENABLE_PGO=OFF"
177- else
178- build_runs_on="depot-macos-14"
179- fi
180- test_runs_on="${{ inputs.runs-on }}"
181- ;;
182- *)
183- test_runs_on="${{ inputs.runs-on }}"
184- build_runs_on=$test_runs_on
185- ;;
186- esac
187200 echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
188201 echo "build-flang=$build_flang" >> $GITHUB_OUTPUT
189202 echo "build-runs-on=$build_runs_on" >> $GITHUB_OUTPUT
@@ -231,8 +244,7 @@ jobs:
231244 # so we need to set some extra cmake flags to disable this.
232245 cmake -G Ninja -S llvm -B ${{ steps.setup-stage.outputs.build-prefix }}/build \
233246 ${{ needs.prepare.outputs.target-cmake-flags }} \
234- -C clang/cmake/caches/Release.cmake \
235- -DBOOTSTRAP_BOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}"
247+ -C clang/cmake/caches/Release.cmake
236248
237249 - name : Build
238250 shell : bash
0 commit comments