)]}'
{
  "commit": "32a8daf6235f6cd7d94ef2fa9dfffc481d4a6f60",
  "tree": "7b3aade0656432004c1b161774e6a7b277b20b05",
  "parents": [
    "e30d778f3029b78bb9c2e0dbe11a3b7389b652c4",
    "4efd16754f76122bfef88dadf4ff22430418f82a"
  ],
  "author": {
    "name": "Jonathan Brouwer",
    "email": "jonathantbrouwer@gmail.com",
    "time": "Sat Nov 07 14:24:58 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sat Nov 07 14:24:58 2026 +0100"
  },
  "message": "Rollup merge of #164784 - cezarbbb:overhaul-size-flags, r\u003doli-obk\n\nIntroduce OptimizationObjective and fix the entry shim\u0027s size attributes\n\n~~The MIR inliner\u0027s 2 \u003d\u003e arm allow-lists `More | Aggressive` by hand. `s/z` also derive MIR level 2, so the pass never runs there. I could not find why in the source or the history — the gate predates the tiered match and read `mir_opt_level() \u003e\u003d 3`, which `s/z` never satisfied either, and `Size/SizeMin` simply were not among the entries considered when the match was written. There is no revert or regression behind it. Dumping every MIR pass at all four levels, the pass sets at `2/3` and at `s/z` differ by exactly one name: Inline. So I enabled it through `PassPolicy::size_only()` and measured.~~\n\n~~The general situation is as follows:~~\n~~For the `.text` section in `rlib` files, I tested 24 crates; the results were −3.59% (17/24) for `os` and −5.78% (16/24) for `oz`.\nAdditional test data includes:~~\n~~76-crate sample, Σ stripped: −0.08% (`os`), −0.13% (`oz`)~~\n~~22 apps, Σ stripped: −0.09% (`os`), −0.07% (`oz`)~~\n~~22 apps, on-disk bytes: −0.40% (7/22) (`os`), −0.74% (11/22) for (`oz`)~~\n~~22 apps, Σ .text: +0.18% (`os`), +0.84% ​​(`oz`)~~\n\n~~Is enabling MIR inlining at `s/z` the right direction, given that it clearly shrinks libraries and application binaries on disk while growing application `.text`?~~\n\n*Update*: as @oli-obk asked, the refactoring is now its own commit. The MIR inliner change will move out to another PR. The measurements above are why I still think it is worth doing, but it does not belong in this PR.\n\nWhen I Split it out I found that LLVM 23 no longer has `Os/Oz` as pipeline levels, they both build the `O2` pipeline now, and what marks a function as size-optimized is the `optsize/minsize` attribute on it. So at `-Copt-level\u003ds/z` there is no longer any setting rustc hands to LLVM that says \"this is a size build\", it is entirely per-function.\n\nIt exposed a gap that the C entry shim and `__rust_try` have no item behind them and never go through the per-item attribute path, so they were the only definitions in a size build that LLVM optimized for speed. They now get the same attributes as everything else.\n\nThe refactoring itself gives size-versus-speed a name and moves the sites that are really asking \"what is this build optimizing for\" onto it. The ones that are asking \"how hard\" — the linker and pipeline level tables, where `s` and `z` map to different strings, still match on `OptLevel`. `CodeGenOptSize` was already being discarded at its only call site, so it is gone.\n\nThere are codegen tests for each knob that now reads the objective, at `2`, `s` and `z`.\n",
  "tree_diff": []
}
