T Compiler Meeting Agenda 2023 08 10

T-compiler Meeting Agenda 2023-08-10

Announcements

Other WG meetings (calendar link)

MCPs/FCPs

WG checkins

  • @_WG-async-foundations by @nikomatsakis and @tmandry (previous checkin):

    Checkin text

Backport nominations

T-compiler stable / T-compiler beta

  • :beta: “lint/ctypes: only try normalize” rust#113921
    • Fixes P-medium #113900, ICE when trying to compile an empty crate pulling a specific crate abi_stable as dependency
  • :beta: “Restrict linker version script of proc-macro crates to just its two symbols” rust#114470
    • Fixes #111888 and #99978
    • “Restrict linker version script of proc-macro crates to just the two symbols of each proc-macro crate.”
  • No stable nominations for T-compiler this time.

PRs S-waiting-on-team

T-compiler

Issues of Note

Short Summary

P-critical

T-compiler

  • “Recursion using extern "C" causes miscompilation” rust#114312
    • Seems to have regressed in the LLVM 16 upgrade, #109474 (comment)
    • Should be resolved by LLVM fix llvm-project#150
    • PR is also I-compiler-nominated to discuss an LLVM 16 backport
  • “Miscompilation when matching on an enum after printing Hello world” rust#114691
    • Regressed in LLVM 17 upgrade
    • @Nikita Popov reported upstream llvm-project#64589 and self-assigned (:heart:)

T-types

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

T-rustdoc

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

P-high regressions

P-high beta regressions

  • No P-high beta regressions this time.

Unassigned P-high nightly regressions

  • “regex miscompiles with aggressive optimization flags” rust#114488
    • bisected to #109025
    • (confirm P-high)?

Performance logs

triage logs for 2023-08-08

Overall a very positive week, primarily due to an upgrade to LLVM 17 and some changes to lint execution. Memory usage is down 4-7% over the last week and wall times are down 3-5%.

Triage done by @simulacrum. Revision range: 828bdc2c26f5c95773c4ecf72870919f16417b66..443c3161dd04f4c1b656a626f9079921bee9c326

Summary:

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -3.1% [-7.1%, -1.2%] 253
Improvements (secondary) -4.1% [-28.4%, -0.3%] 233
All (primary) -3.1% [-7.1%, -1.2%] 253

2 Regressions, 7 Improvements, 2 Mixed; 2 of them in rollups 64 artifact comparisons made in total

Regressions

Rollup of 9 pull requests #114481 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.8% [0.4%, 1.5%] 80
Regressions (secondary) 0.7% [0.2%, 1.2%] 25
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.8% [0.4%, 1.5%] 80

Unclear what is causing this regression. It’s entirely limited to the incr-patched and incr-unchanged scenarios, and digging into one of the benchmarks (bitmaps-3.1.0 check incr-unchanged) seems to show a mix of noise and, in aggregate, significant improvements over the last several days. Not clear which PR in this rollup could have caused this change in behavior.

See these comments for some more details.

Re-enable atomic loads and stores for all RISC-V targets #98333 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.8% [0.4%, 1.3%] 18
Regressions (secondary) 0.6% [0.2%, 0.9%] 12
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.8% [0.4%, 1.3%] 18

This PR has a very similar regression profile to the previous rollup in this list (#114481).

Improvements

Remove constness from TraitPredicate #114202 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -0.7% [-0.9%, -0.4%] 16
Improvements (secondary) -0.6% [-1.2%, -0.3%] 13
All (primary) -0.7% [-0.9%, -0.4%] 16

cg_llvm: stop identifying ADTs in LLVM IR #114350 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -0.8% [-1.2%, -0.6%] 5
Improvements (secondary) -1.1% [-1.5%, -0.6%] 6
All (primary) -0.8% [-1.2%, -0.6%] 5

Convert builtin “global” late lints to run per module #113734 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) 0.5% [0.4%, 0.8%] 3
Improvements (primary) -1.7% [-3.4%, -0.2%] 88
Improvements (secondary) -4.2% [-26.5%, -0.2%] 85
All (primary) -1.7% [-3.4%, -0.2%] 88

parent_module_from_def_id does not need to be a query. #114516 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.3% [0.2%, 0.4%] 2
Regressions (secondary) - - 0
Improvements (primary) -1.4% [-2.0%, -1.1%] 17
Improvements (secondary) -1.2% [-1.5%, -0.3%] 11
All (primary) -1.2% [-2.0%, 0.4%] 19

Steal MIR for CTFE when possible. #114502 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -0.6% [-0.6%, -0.6%] 1
Improvements (secondary) -1.5% [-2.6%, -0.5%] 19
All (primary) -0.6% [-0.6%, -0.6%] 1

Update to LLVM 17 #114048 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -2.2% [-5.6%, -0.8%] 173
Improvements (secondary) -2.2% [-12.9%, -0.5%] 199
All (primary) -2.2% [-5.6%, -0.8%] 173

This represents a large win across multiple benchmarks. Unfortunately it also regresses artifact sizes for libLLVM.so by 50MB. Investigation into why is ongoing.

Do not run ConstProp on mir_for_ctfe. #114459 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.2% [0.2%, 0.2%] 1
Regressions (secondary) - - 0
Improvements (primary) -0.8% [-1.2%, -0.5%] 8
Improvements (secondary) -1.7% [-3.0%, -1.1%] 7
All (primary) -0.7% [-1.2%, 0.2%] 9

The one regression is actually within noise floor for the relevant benchmark.

Mixed

Optimize Iterator implementation for &mut impl Iterator + Sized #111200 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.4% [0.3%, 0.5%] 6
Regressions (secondary) - - 0
Improvements (primary) - - 0
Improvements (secondary) -0.7% [-0.9%, -0.5%] 2
All (primary) 0.4% [0.3%, 0.5%] 6

Rollup of 7 pull requests #114604 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 1.4% [0.4%, 2.0%] 3
Regressions (secondary) 1.2% [1.1%, 1.3%] 6
Improvements (primary) -0.7% [-0.9%, -0.4%] 2
Improvements (secondary) -1.0% [-1.5%, -0.5%] 2
All (primary) 0.5% [-0.9%, 2.0%] 5

Investigation into cause is ongoing.

Nominated Issues

T-compiler

  • “Recursion using extern "C" causes miscompilation” rust#114312
    • Nominated by @Josh Stone (cuviper) in comment: LLVM PR author @_DianQK suggests an LLVM 16 backport - sort of unusual for us
  • “Non-temporal stores (and _mm_stream operations in stdarch) break our memory model” rust#114582
    • I-lang-nominated, FIY to T-compiler
    • (comment) The nontemporal-store intrinsic was introduced in fe53a81, with a comment saying this will likely never be stable but then accidentally stabilized in stdarch#414
  • “Associated type constraints on super traits allowing for unsound transmutation to trait objects” rust#114389
    • nominated by @apiraino (comment)
    • Prioritization comment: “If understand correctly this is a symptom of another old issue #57893. I cannot grasp the context but the linked #57893 is an unsoundeness marked as P-high since 2019, then demoted in 2020, then again P-high”

RFC

  • No I-compiler-nominated RFCs this time.

Oldest PRs waiting for review

  • -Z trait-solver=next: Deduplicate region constraints in query responses” rust#111172
    • cc: @lcnr
  • “Rebased: Mark drop calls in landing pads cold instead of noinline” rust#102099(last review activity: 2 months ago)
    • @Nikita Popov asking for someone to look into the MSVC in this PR (comment)
    • Seems kind of related to the discussion we had last week about MSVC target tier support (summary)
  • “Only emit one error per unsized binding, instead of one per usage” rust#113183(last review activity: about 41 days ago)
    • was reassigned to @_TaKO8Ki, reroll to someone else of WG-diag?
  • “fix: extract rustc_test_marker attr in test_case” rust#113315(last review activity: about 37 days ago)
    • assigned to @Jack Huey then @Vadim Petrochenkov was mentioned. Reroll this one?

Next week’s WG checkins

  • TBA

Next meetings' agenda draft: https://hackmd.io/c9KaX3GNRZSKbIUp3SJpJw