File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -124,15 +124,27 @@ def bolt_clang(self):
124124 bolt_readme = Path (self .folders .source , 'bolt/README.md' ).read_text (encoding = 'utf-8' )
125125 use_cache_plus = '-reorder-blocks=cache+' in bolt_readme
126126 use_sf_val = '-split-functions=2' in bolt_readme
127+ if (bolt_cmd_ref := Path (self .folders .source ,
128+ 'bolt/docs/CommandLineArgumentReference.md' )).exists ():
129+ bolt_cmd_ref_txt = bolt_cmd_ref .read_text (encoding = 'utf-8' )
130+ # https://github.com/llvm/llvm-project/commit/3c357a49d61e4c81a1ac016502ee504521bc8dda
131+ icf_val = 'all' if '--icf=<value>' in bolt_cmd_ref_txt else '1'
132+ else :
133+ icf_val = '1'
134+ # https://github.com/llvm/llvm-project/commit/9058503d2690022642d952ee80ecde5ecdbc79ca
135+ if Path (self .folders .source , 'bolt/lib/Passes/HFSortPlus.cpp' ).exists ():
136+ reorder_funcs_val = 'hfsort+'
137+ else :
138+ reorder_funcs_val = 'cdsort'
127139 clang_opt_cmd = [
128140 self .tools .llvm_bolt ,
129141 f"--data={ bolt_profile } " ,
130142 '--dyno-stats' ,
131- ' --icf=1' ,
143+ f" --icf={ icf_val } " ,
132144 '-o' ,
133145 clang_bolt ,
134146 f"--reorder-blocks={ 'cache+' if use_cache_plus else 'ext-tsp' } " ,
135- ' --reorder-functions=hfsort+' ,
147+ f" --reorder-functions={ reorder_funcs_val } " ,
136148 '--split-all-cold' ,
137149 f"--split-functions{ '=3' if use_sf_val else '' } " ,
138150 '--use-gnu-stack' ,
You can’t perform that action at this time.
0 commit comments