diff --git a/tc_build/llvm.py b/tc_build/llvm.py index afc9c052..be5e4f7c 100644 --- a/tc_build/llvm.py +++ b/tc_build/llvm.py @@ -115,6 +115,9 @@ def bolt_clang(self): self.bolt_builder.bolt_sampling_output.unlink() # Now actually optimize clang + bolt_readme = Path(self.folders.source, 'bolt/README.md').read_text(encoding='utf-8') + use_cache_plus = '-reorder-blocks=cache+' in bolt_readme + use_sf_val = '-split-functions=2' in bolt_readme clang_opt_cmd = [ self.tools.llvm_bolt, f"--data={bolt_profile}", @@ -122,10 +125,10 @@ def bolt_clang(self): '--icf=1', '-o', clang_bolt, - '--reorder-blocks=cache+', + f"--reorder-blocks={'cache+' if use_cache_plus else 'ext-tsp'}", '--reorder-functions=hfsort+', '--split-all-cold', - '--split-functions=3', + f"--split-functions{'=3' if use_sf_val else ''}", '--use-gnu-stack', clang, ]