T Compiler Meeting Agenda 2022 07 21

T-compiler Meeting Agenda 2022-07-21

Announcements

Other WG meetings

MCPs/FCPs

  • New MCPs (take a look, see if you like them!)
  • Old MCPs (not seconded, take a look)
    • “Arbitrary annotations in compiletest” compiler-team#513 (last review activity: 2 months ago)
    • “Add support for the LoongArch architecture” compiler-team#518 (last review activity: about 33 days ago)
  • Pending FCP requests (check your boxes!)
    • “Increase the minimum linux-gnu versions” rust#95026
  • Things in FCP (make sure you’re good with it)
  • Accepted MCPs
  • Finalized FCPs (disposition merge)
    • “Remove migrate borrowck mode” rust#95565
    • “Modify MIR building to drop repeat expressions with length zero” rust#95953
    • “Lang: Stabilize usage of rustc_nonnull_optimization_guaranteed on -1” rust#97122
    • “Remove a back-compat hack on lazy TAIT” rust#97346
    • “Make outlives::{components,verify} agree” rust#97406
    • “make cenum_impl_drop_cast deny-by-default” rust#97652
    • “make const_err show up in future breakage reports” rust#97743
    • “lub: don’t bail out due to empty binders” rust#97867
    • “allow unions with mutable references and tuples of allowed types” rust#97995

WG checkins

  • @_WG-mir-opt by @oli (previous checkin)

    • we now run the MIR inliner by default in release mode
    • const prop lints now run before optimizations so that they are no longer influenced by other mir opts (like inlining)
    • optimization MIR and codegen MIR no longer have Deref projections in the middle of a place projection, only at the start, which simplified a few backend things and optimizations.
  • @_wg-polymorphization by @davidtwco (previous checkin)

    Nothing from wg-polymorphization this cycle.

Backport nominations

T-compiler beta / T-compiler stable

  • :beta: “[beta] Do not call check_expr twice in check_compatiblerust#99397
    • fixes #98894 and #98897
    • approved by @Jack Huey, needs merge
  • :beta: “Revert “Stabilize $$ in Rust 1.63.0"” rust#99435
  • :beta: “Do not resolve associated const when there is no provided value” rust#99449
    • fixes rust#98629, P-high regression
    • pending comments from @lqd and merge
  • No stable nominations for T-compiler this time.

T-rustdoc beta / T-rustdoc stable

  • No beta nominations for T-rustdoc this time.
  • No stable nominations for T-rustdoc this time.

:back: / :shrug: / :hand:

PRs S-waiting-on-team

T-compiler

  • No new PRs waiting on team

Oldest PRs waiting for review

T-compiler

  • “Support #[global_allocator] without the allocator shim” rust#86844 (last review activity: 3 months ago)
    • cc Felix
  • “Add [f32]::sort_floats and [f64]::sort_floatsrust#93397 (last review activity: 3 months ago)
    • assigned to @kennytm , reroll assignment?
  • “Add special_module_name lint” rust#94467 (last review activity: 3 months ago)
    • cc Felix
  • “Simplify some code that depend on Deref” rust#97077 (last review activity: about 46 days ago)
    • cc @oli (maybe not S-blocked anymore)
  • “[RFC] Support .comment section like GCC/Clang (!llvm.ident)” rust#97550 (last review activity: about 35 days ago)
    • needs an FCP but @bjorn3 or @Miguel Ojeda have no permission to start one: can someone assist them?

Issues of Note

Short Summary

P-critical

T-compiler

  • “Recent nightly started ICEing with “No counters provided the source_hash for used function”” rust#98833
    • PR to resolve rust#98868 authored by @tm|352985
    • needs reviewer

T-rustdoc

  • No P-critical issues for T-rustdoc this time.

P-high regressions

P-high beta regressions

  • “evaluation error hides “impl item missing” error” rust#98629
    • @Michael Goulet (compiler-errors) authored PR rust#99449, nominated for beta backport

Unassigned P-high nightly regressions

  • No unassigned P-high nightly regressions this time.

Performance logs

triage logs for 2022-07-19

A rather rough week for compiler performance with regressions outweighing improvements by a considerable margin, in particular in real world crates. To add insult to injury, the biggest regressions came in rollups which make it difficult to trace the cause.

Triage done by @rylev. Revision range: b3f4c3119957aa0a250cab08ab586b7a9a680ef1..8bd12e8cca3f28f302b9cc0f1f47bb64bd1f98fd

Summary:

mean max count
Regressions (primary) 1.5% 4.0% 176
Regressions (secondary) 1.8% 6.4% 147
Improvements (primary) N/A N/A 0
Improvements (secondary) -1.6% -4.1% 9
All (primary) 1.5% 4.0% 176

7 Regressions, 5 Improvements, 3 Mixed; 4 of them in rollups 48 artifact comparisons made in total

Regressions

Rollup of 6 pull requests #99177 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) 0.5% 0.6% 9
Improvements (primary) N/A N/A 0
Improvements (secondary) N/A N/A 0
All (primary) N/A N/A 0
  • Relatively small regression in secondary benchmarks. Nothing stands out as an obvious culprit, so we can mark as triaged.

Pull Derefer before ElaborateDrops #98145 (Comparison Link)

mean max count
Regressions (primary) 0.5% 0.8% 13
Regressions (secondary) 0.7% 1.1% 20
Improvements (primary) N/A N/A 0
Improvements (secondary) N/A N/A 0
All (primary) 0.5% 0.8% 13
  • Slowdowns are happening in MIR borrow checking which this PR directly changes, so regressions are not surprising.
  • An issue should be opened to look into whether this can be improved.
  • A comment was left asking for a follow up.

Rollup of 5 pull requests #99210 (Comparison Link)

mean max count
Regressions (primary) 2.6% 4.5% 7
Regressions (secondary) 1.6% 4.1% 55
Improvements (primary) N/A N/A 0
Improvements (secondary) N/A N/A 0
All (primary) 2.6% 4.5% 7
  • Seems the issue comes from calling an LLVM API more often due to needing to have unstable feature information kept around longer for use with the asm! macro.
  • Ran a cachegrind diff and found that the likely culprit is #99155 calling LLVMRustHasFeature more often.
  • Left a comment asking for a follow up.

Rollup of 5 pull requests #99231 (Comparison Link)

mean max count
Regressions (primary) 1.2% 3.2% 117
Regressions (secondary) 1.7% 6.4% 35
Improvements (primary) N/A N/A 0
Improvements (secondary) -0.3% -0.3% 1
All (primary) 1.2% 3.2% 117
  • It’s very hard to tell which PR might be responsible. Luckily, there are only 5 PRs in total so it should be possible to track the issue down.
  • Left a comment suggesting as much.

Support unstable moves via stable in unstable items #95956 (Comparison Link)

mean max count
Regressions (primary) 0.5% 0.9% 13
Regressions (secondary) 0.6% 1.2% 10
Improvements (primary) N/A N/A 0
Improvements (secondary) N/A N/A 0
All (primary) 0.5% 0.9% 13
  • The change seems to be localized to incremental compilation scenarios.
  • It seems queries like incr_comp_encode_dep_graph are being hit more often. I’m unsure whether this is simply because of the additional pass that’s happening or something else.
  • Left a comment asking for more insight.

Rollup of 10 pull requests #99346 (Comparison Link)

mean max count
Regressions (primary) 0.6% 2.6% 136
Regressions (secondary) 1.0% 5.8% 100
Improvements (primary) N/A N/A 0
Improvements (secondary) N/A N/A 0
All (primary) 0.6% 2.6% 136

Use ICF (identical code folding) for building rustc #99062 (Comparison Link)

mean max count
Regressions (primary) 0.3% 0.4% 2
Regressions (secondary) 2.6% 2.6% 3
Improvements (primary) N/A N/A 0
Improvements (secondary) N/A N/A 0
All (primary) 0.3% 0.4% 2

Improvements

gather body owners #98203 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) 0.6% 0.6% 1
Improvements (primary) -0.4% -0.7% 30
Improvements (secondary) -0.5% -0.8% 18
All (primary) -0.4% -0.7% 30

interpret: get rid of MemPlaceMeta::Poison #99013 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) 0.5% 0.5% 1
Improvements (primary) N/A N/A 0
Improvements (secondary) -1.6% -2.5% 12
All (primary) N/A N/A 0

stop using FnCtxt outside of hir typeck #99015 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) N/A N/A 0
Improvements (primary) -0.6% -0.9% 11
Improvements (secondary) -0.4% -0.6% 11
All (primary) -0.6% -0.9% 11

Use constant eval to do strict mem::uninit/zeroed validity checks #99033 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) N/A N/A 0
Improvements (primary) N/A N/A 0
Improvements (secondary) -2.2% -2.9% 6
All (primary) N/A N/A 0

replace_bound_vars fast path: check predicates, don’t check consts #99232 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) N/A N/A 0
Improvements (primary) -0.6% -0.7% 6
Improvements (secondary) N/A N/A 0
All (primary) -0.6% -0.7% 6

Mixed

Stop keeping metadata in memory before writing it to disk #96544 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) 0.3% 0.4% 3
Improvements (primary) -0.3% -0.3% 1
Improvements (secondary) -4.1% -4.1% 2
All (primary) -0.3% -0.3% 1
  • The perf here is a wash.

Final derive output improvements #99046 (Comparison Link)

mean max count
Regressions (primary) 0.5% 0.6% 8
Regressions (secondary) N/A N/A 0
Improvements (primary) -0.6% -0.9% 19
Improvements (secondary) -2.8% -3.7% 6
All (primary) -0.2% -0.9% 27
  • Improvements much outweigh the regressions as noted here.

proc_macro/bridge: stop using a remote object handle for proc_macro Ident and Literal #98189 (Comparison Link)

mean max count
Regressions (primary) 1.0% 2.2% 4
Regressions (secondary) N/A N/A 0
Improvements (primary) -0.7% -1.7% 19
Improvements (secondary) -3.0% -3.1% 3
All (primary) -0.4% 2.2% 23
  • Still more improvements than regressions, and this is an active area of performance work as noted here.

Nominated Issues

T-compiler

  • “Revert #94158, “Apply noundef metadata to loads of types that do not permit raw init”” rust#98966
    • nominated by @Ben Kimock (Saethlin)

      In #66151 we have decided against turning technically UB code into a panic on account of the amount of code that would be affected, so it doesn’t seem right to turn technically into directly visible to LLVM. If the breakage from adding a panic for this case is too high, the danger from turning this case into visible UB should be as well.

    • cc @Thom Chiovoloni
    • Seems to be replaced by rust#99182? (see comment)

RFC

  • No nominated RFCs for T-compiler this time.

Next week’s WG checkins

  • @_WG-rls2.0 by @matklad
  • @_WG-self-profile by @mw and @Wesley Wiser