Skip to content

Commit

Permalink
Merge pull request #254 from nathanchance/fix-pgo-llvm-distribution-c…
Browse files Browse the repository at this point in the history
…omponents

build-llvm.py: Fix PGO using LLVM as training data without '--full-toolchain'
  • Loading branch information
nathanchance authored Nov 15, 2023
2 parents 4b86fd2 + 17103fc commit 5c6f834
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build-llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,14 @@
llvm_builder.show_commands = args.show_build_commands
llvm_builder.targets = final.targets
llvm_builder.tools = StageTools(Path(instrumented.folders.build, 'bin'))
# clang-tblgen and llvm-tblgen may not be available from the
# instrumented folder if the user did not pass '--full-toolchain', as
# only the tools included in the distribution will be available. In
# that case, use the bootstrap versions, which should not matter much
# for profiling sake.
if not args.full_toolchain:
llvm_builder.tools.clang_tblgen = Path(bootstrap.folders.build, 'bin/clang-tblgen')
llvm_builder.tools.llvm_tblgen = Path(bootstrap.folders.build, 'bin/llvm-tblgen')
pgo_builders.append(llvm_builder)

# If the user specified both a full and slim build of the same type, remove
Expand Down

0 comments on commit 5c6f834

Please sign in to comment.