@@ -12,7 +12,9 @@ use crate::environment::{Environment, EnvironmentBuilder};
12
12
use crate :: exec:: { cmd, Bootstrap } ;
13
13
use crate :: tests:: run_tests;
14
14
use crate :: timer:: Timer ;
15
- use crate :: training:: { gather_bolt_profiles, gather_llvm_profiles, gather_rustc_profiles} ;
15
+ use crate :: training:: {
16
+ gather_bolt_profiles, gather_llvm_profiles, gather_rustc_profiles, llvm_benchmarks,
17
+ } ;
16
18
use crate :: utils:: io:: { copy_directory, move_directory, reset_directory} ;
17
19
use crate :: utils:: {
18
20
clear_llvm_files, format_env_variables, print_binary_sizes, print_free_disk_space,
@@ -270,9 +272,9 @@ fn execute_pipeline(
270
272
log:: info!( "Optimizing {llvm_lib} with BOLT" ) ;
271
273
272
274
// Instrument it and gather profiles
273
- let profile = with_bolt_instrumented ( & llvm_lib, || {
275
+ let profile = with_bolt_instrumented ( & llvm_lib, |llvm_profile_dir | {
274
276
stage. section ( "Gather profiles" , |_| {
275
- gather_bolt_profiles ( env, "LLVM" , llvm_benchmarks ( env) )
277
+ gather_bolt_profiles ( env, "LLVM" , llvm_benchmarks ( env) , llvm_profile_dir )
276
278
} )
277
279
} ) ?;
278
280
print_free_disk_space ( ) ?;
@@ -291,34 +293,34 @@ fn execute_pipeline(
291
293
None
292
294
} ;
293
295
294
- let rustc_bolt_profile = if env. supports_bolt ( ) {
295
- // Stage 4: Build BOLT instrumented rustc
296
- timer. section ( "Stage 4 (Rustc BOLT)" , |stage| {
297
- // Find the path to the `librustc_driver.so` file
298
- let rustc_lib = io:: find_file_in_dir (
299
- & env. build_artifacts ( ) . join ( "stage2" ) . join ( "lib" ) ,
300
- "librustc_driver" ,
301
- ".so" ,
302
- ) ?;
303
-
304
- log:: info!( "Optimizing {rustc_lib} with BOLT" ) ;
305
-
306
- // Instrument it and gather profiles
307
- let profile = with_bolt_instrumented ( & rustc_lib, || {
308
- stage. section ( "Gather profiles" , |_| {
309
- gather_bolt_profiles ( env, "rustc" , rustc_benchmarks ( env) )
310
- } )
311
- } ) ?;
312
- print_free_disk_space ( ) ?;
313
-
314
- // Now optimize the library with BOLT.
315
- bolt_optimize ( & rustc_lib, & profile) . context ( "Could not optimize rustc with BOLT" ) ?;
316
-
317
- Ok ( Some ( profile) )
318
- } ) ?
319
- } else {
320
- None
321
- } ;
296
+ // let rustc_bolt_profile = if env.use_bolt () {
297
+ // // Stage 4: Build BOLT instrumented rustc
298
+ // timer.section("Stage 4 (Rustc BOLT)", |stage| {
299
+ // // Find the path to the `librustc_driver.so` file
300
+ // let rustc_lib = io::find_file_in_dir(
301
+ // &env.build_artifacts().join("stage2").join("lib"),
302
+ // "librustc_driver",
303
+ // ".so",
304
+ // )?;
305
+ //
306
+ // log::info!("Optimizing {rustc_lib} with BOLT");
307
+ //
308
+ // // Instrument it and gather profiles
309
+ // let profile = with_bolt_instrumented(&rustc_lib, || {
310
+ // stage.section("Gather profiles", |_| {
311
+ // gather_bolt_profiles(env, "rustc", rustc_benchmarks(env))
312
+ // })
313
+ // })?;
314
+ // print_free_disk_space()?;
315
+ //
316
+ // // Now optimize the library with BOLT.
317
+ // bolt_optimize(&rustc_lib, &profile).context("Could not optimize rustc with BOLT")?;
318
+ //
319
+ // Ok(Some(profile))
320
+ // })?
321
+ // } else {
322
+ // None
323
+ // };
322
324
323
325
let mut dist = Bootstrap :: dist ( env, & dist_args)
324
326
. llvm_pgo_optimize ( & llvm_pgo_profile)
@@ -328,9 +330,9 @@ fn execute_pipeline(
328
330
if let Some ( llvm_bolt_profile) = llvm_bolt_profile {
329
331
dist = dist. with_bolt_profile ( llvm_bolt_profile) ;
330
332
}
331
- if let Some ( rustc_bolt_profile) = rustc_bolt_profile {
332
- dist = dist. with_bolt_profile ( rustc_bolt_profile) ;
333
- }
333
+ // if let Some(rustc_bolt_profile) = rustc_bolt_profile {
334
+ // dist = dist.with_bolt_profile(rustc_bolt_profile);
335
+ // }
334
336
335
337
// Final stage: Assemble the dist artifacts
336
338
// The previous PGO optimized rustc build and PGO optimized LLVM builds should be reused.
0 commit comments