Skip to content

Commit 4fb7144

Browse files
committed
Auto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] 1.43.0 release Includes a last minute backport of #71267.
2 parents 062dea0 + a00194e commit 4fb7144

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

Diff for: src/ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fi
4343
#
4444
# FIXME: need a scheme for changing this `nightly` value to `beta` and `stable`
4545
# either automatically or manually.
46-
export RUST_RELEASE_CHANNEL=beta
46+
export RUST_RELEASE_CHANNEL=stable
4747

4848
# Always set the release channel for bootstrap; this is normally not important (i.e., only dist
4949
# builds would seem to matter) but in practice bootstrap wants to know whether we're targeting

Diff for: src/librustc_codegen_llvm/back/lto.rs

+22-10
Original file line numberDiff line numberDiff line change
@@ -500,15 +500,32 @@ fn thin_lto(
500500
let module_name = module_name_to_str(module_name);
501501

502502
// If (1.) the module hasn't changed, and (2.) none of the modules
503-
// it imports from nor exports to have changed, *and* (3.) the
504-
// import and export sets themselves have not changed from the
505-
// previous compile when it was last ThinLTO'ed, then we can re-use
506-
// the post-ThinLTO version of the module. Otherwise, freshly
507-
// perform LTO optimization.
503+
// it imports from have changed, *and* (3.) the import and export
504+
// sets themselves have not changed from the previous compile when
505+
// it was last ThinLTO'ed, then we can re-use the post-ThinLTO
506+
// version of the module. Otherwise, freshly perform LTO
507+
// optimization.
508508
//
509509
// (Note that globally, the export set is just the inverse of the
510510
// import set.)
511511
//
512+
// For further justification of why the above is necessary and sufficient,
513+
// see the LLVM blog post on ThinLTO:
514+
//
515+
// http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
516+
//
517+
// which states the following:
518+
//
519+
// ```quote
520+
// any particular ThinLTO backend must be redone iff:
521+
//
522+
// 1. The corresponding (primary) module’s bitcode changed
523+
// 2. The list of imports into or exports from the module changed
524+
// 3. The bitcode for any module being imported from has changed
525+
// 4. Any global analysis result affecting either the primary module
526+
// or anything it imports has changed.
527+
// ```
528+
//
512529
// This strategy means we can always save the computed imports as
513530
// canon: when we reuse the post-ThinLTO version, condition (3.)
514531
// ensures that the current import set is the same as the previous
@@ -531,13 +548,8 @@ fn thin_lto(
531548
let imports_all_green = curr_imports
532549
.iter()
533550
.all(|imported_module| green_modules.contains_key(imported_module));
534-
let exports_all_green = curr_exports
535-
.iter()
536-
.all(|exported_module| green_modules.contains_key(exported_module));
537-
538551
if imports_all_green
539552
&& equivalent_as_sets(prev_imports, curr_imports)
540-
&& exports_all_green
541553
&& equivalent_as_sets(prev_exports, curr_exports)
542554
{
543555
let work_product = green_modules[module_name].clone();

0 commit comments

Comments
 (0)