Skip to content

Commit 1be41d2

Browse files
committed
Bring back PGO for LLVM itself
1 parent 4bfa4ee commit 1be41d2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/tools/opt-dist/src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,6 @@ fn execute_pipeline(
280280
// Here we build a PGO instrumented LLVM, reusing the previously PGO optimized rustc.
281281
// Then we use the instrumented LLVM to gather LLVM PGO profiles.
282282
let llvm_pgo_profile = timer.section("Stage 2 (LLVM PGO)", |stage| {
283-
if 1 + 1 == 2 {
284-
return Err(anyhow::anyhow!("disabled"));
285-
}
286283
// Remove the previous, uninstrumented build of LLVM.
287284
clear_llvm_files(env)?;
288285

@@ -305,7 +302,7 @@ fn execute_pipeline(
305302
clear_llvm_files(env)?;
306303

307304
Ok(profile)
308-
});
305+
})?;
309306

310307
let bolt_profiles = if env.use_bolt() {
311308
// Stage 3: Build BOLT instrumented LLVM
@@ -317,7 +314,7 @@ fn execute_pipeline(
317314
stage.section("Build PGO optimized LLVM", |stage| {
318315
Bootstrap::build(env)
319316
.with_llvm_bolt_ldflags()
320-
.llvm_pgo_optimize(&llvm_pgo_profile?)
317+
.llvm_pgo_optimize(&llvm_pgo_profile)
321318
.avoid_rustc_rebuild()
322319
.run(stage)
323320
})?;
@@ -369,6 +366,7 @@ fn execute_pipeline(
369366
};
370367

371368
let mut dist = Bootstrap::dist(env, &dist_args)
369+
.llvm_pgo_optimize(&llvm_pgo_profile)
372370
.rustc_pgo_optimize(&rustc_pgo_profile)
373371
.avoid_rustc_rebuild();
374372

0 commit comments

Comments
 (0)