Skip to content

Commit

Permalink
[BOLT] Combine two clang-bolt builders into one
Browse files Browse the repository at this point in the history
Use BOLT.cmake and BOLT-PGO.cmake to run comprehensive
BOLT testing with Clang:
- `clang-bolt` instruments and optimizes 1st stage Clang built
with host GCC.
- `stage2-clang-bolt` uses optimized Clang to build 2nd stage
Clang (with PGO+LTO), then instruments/optimizes that binary.

This flow provides testing coverage of both clang-bolt-gcc
and clang-bolt-lto-pgo. BOLT is applied to GCC- and Clang-built
clang binary. Additionally, this extends BOLT testing by running
BOLT-optimized Clang to build 2nd stage Clang.

Reviewed By: gkistanova

Differential Revision: https://reviews.llvm.org/D142854
  • Loading branch information
aaupov committed Feb 2, 2023
1 parent 276c07a commit 5480e55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 27 deletions.
30 changes: 8 additions & 22 deletions buildbot/osuosl/master/config/builders.py
Expand Up @@ -2510,42 +2510,28 @@
is_nfc=True,
)},

{'name': "bolt-x86_64-ubuntu-clang-bolt-gcc",
{'name': "bolt-x86_64-ubuntu-clang",
'tags': ["bolt"],
'workernames':["bolt-worker"],
'builddir': "bolt-x86_64-ubuntu-clang-bolt-gcc",
'builddir': "bolt-x86_64-ubuntu-clang",
'factory' : BOLTBuilder.getBOLTCmakeBuildFactory(
bolttests=False,
clean=True,
depends_on_projects=['bolt', 'clang', 'llvm'],
cache='clang/cmake/caches/BOLT.cmake',
depends_on_projects=['bolt', 'clang', 'lld', 'llvm'],
caches=[
'clang/cmake/caches/BOLT.cmake',
'clang/cmake/caches/BOLT-PGO.cmake',
],
targets=['clang-bolt'],
checks=['stage2-clang-bolt'],
extra_configure_args=[
"-DCMAKE_C_COMPILER=gcc",
"-DCMAKE_CXX_COMPILER=g++",
"-DLLVM_APPEND_VC_REV=OFF",
"-DLLVM_CCACHE_BUILD=ON",
"-DBOLT_LLD_EXE=/usr/bin/ld.lld",
],
)},


{'name': "bolt-x86_64-ubuntu-clang-bolt-lto-pgo",
'tags': ["bolt"],
'workernames':["bolt-worker"],
'builddir': "bolt-x86_64-ubuntu-clang-bolt-lto-pgo",
'factory' : BOLTBuilder.getBOLTCmakeBuildFactory(
bolttests=False,
clean=True,
depends_on_projects=['bolt', 'clang', 'lld', 'llvm'],
cache='clang/cmake/caches/BOLT-PGO.cmake',
targets=['stage2-clang-bolt'],
extra_configure_args=[
"-DLLVM_APPEND_VC_REV=OFF",
"-DLLVM_ENABLE_LLD=ON",
"-DBOOTSTRAP_LLVM_ENABLE_LLD=ON",
"-DBOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_LLD=ON",
"-DLLVM_CCACHE_BUILD=ON",
"-DBOOTSTRAP_LLVM_CCACHE_BUILD=ON",
"-DPGO_INSTRUMENT_LTO=Thin",
],
Expand Down
9 changes: 4 additions & 5 deletions zorg/buildbot/builders/BOLTBuilder.py
Expand Up @@ -12,7 +12,7 @@ def getBOLTCmakeBuildFactory(
is_nfc = False,
targets = None,
checks = None,
cache = None,
caches = None,
extra_configure_args = None,
env = None,
depends_on_projects = None,
Expand Down Expand Up @@ -63,10 +63,9 @@ def getBOLTCmakeBuildFactory(
('-G', 'Ninja'),
])

if cache:
CmakeCommand.applyRequiredOptions(extra_configure_args, [
("-C", f"../{f.monorepo_dir}/{cache}"),
])
if caches:
for cache in caches:
extra_configure_args += [f"-C../{f.monorepo_dir}/{cache}"]

addCmakeSteps(
f,
Expand Down

0 comments on commit 5480e55

Please sign in to comment.