Skip to content

pre-commit: PR147327 #2567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

pre-commit: PR147327 #2567

wants to merge 3 commits into from

Conversation

zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Jul 9, 2025

Link: llvm/llvm-project#147327
Requested by: @nikic

@github-actions github-actions bot mentioned this pull request Jul 9, 2025
@zyw-bot
Copy link
Collaborator Author

zyw-bot commented Jul 9, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@61d52ea
patch: llvm/llvm-project#147327
sha256: 0a0ab5fcb99cdb6dfb5a8b57d5e9a32a07e43ce7d6a767d3e8040fa90ffda936
commit: 6304bf7

251 files changed, 193827 insertions(+), 201169 deletions(-)

Improvements:
  correlated-value-propagation.NumMulNUW 63430 -> 64020 +0.93%
  correlated-value-propagation.NumMulNW 143179 -> 143650 +0.33%
  correlated-value-propagation.NumNUW 617270 -> 617782 +0.08%
  correlated-value-propagation.NumNW 1076762 -> 1077169 +0.04%
  correlated-value-propagation.NumCmps 300645 -> 300736 +0.03%
  gvn.NumGVNEqProp 456558 -> 456658 +0.02%
  jump-threading.NumThreads 2947317 -> 2947765 +0.02%
  instcombine.NumSunkInst 3564735 -> 3565269 +0.01%
  instcombine.NumDeadInst 44233663 -> 44236577 +0.01%
  correlated-value-propagation.NumAddNSW 283117 -> 283132 +0.01%
Regressions:
  correlated-value-propagation.NumOverflows 4792 -> 4746 -0.96%
  correlated-value-propagation.NumMulNSW 79749 -> 79630 -0.15%
  correlated-value-propagation.NumAddNUW 238008 -> 237931 -0.03%
  sccp.NumDeadBlocks 755755 -> 755580 -0.02%
  instcombine.NumReassoc 286963 -> 286916 -0.02%
  correlated-value-propagation.NumNSW 656749 -> 656644 -0.02%
  correlated-value-propagation.NumAddNW 521125 -> 521063 -0.01%
  constraint-elimination.NumCondsRemoved 3573288 -> 3573043 -0.01%
  globalsmodref-aa.NumNoMemFunctions 812315 -> 812263 -0.01%
  globalsmodref-aa.NumReadMemFunctions 1241972 -> 1241920 -0.00%

53 65 bench/actix-rs/optimized/36qa1hw006t0trtl.ll
8 14 bench/image-rs/optimized/2mngkegtim1o10y3.ll
3 7 bench/image-rs/optimized/8143hfqbwzfmz2f.ll
16 22 bench/jiff-rs/optimized/6m1tnqk3cd9x6qpikbz9u32fg.ll
4 7 bench/ockam-rs/optimized/32cbw7iiw6inrqgd.ll
16 28 bench/ockam-rs/optimized/5ayhis8cfs1k9t14.ll
32 44 bench/pingora-rs/optimized/24oggy68gf6cx0i1vzuuyyts4.ll
55 64 bench/pingora-rs/optimized/3ranmvekd7v2u4fuvbinivxwp.ll
32 44 bench/pingora-rs/optimized/bw8p2a096sr4h5kx1qlrukp54.ll
8 11 bench/pola-rs/optimized/1vw7z721g5d72xmmrp5f2wvcz.ll
30 33 bench/pola-rs/optimized/2q6frf75841yfaiibmd58gcnc.ll
32 35 bench/pola-rs/optimized/c4rn3zpjqdots925h9qverc7h.ll
39 42 bench/pola-rs/optimized/dgtr4n6toyrs0lo6gtn8sd4wk.ll
41 47 bench/pola-rs/optimized/ed1rlowz66i0blx6w4sok6vzs.ll
16 22 bench/quiche-rs/optimized/393tr1lo1v2gtavj2ucioo4eo.ll
140 150 bench/quinn-rs/optimized/2pt8m9pq9844wd7saknszqtgs.ll
53 59 bench/raft-rs/optimized/57ebsf7eucg9n66no28qfqzkh.ll
7 10 bench/ruff-rs/optimized/2bkzvz92nvub9c6j7292q4173.ll
40 55 bench/ruff-rs/optimized/coy59l17a1o38979nbp7mcsjf.ll
39 48 bench/ruff-rs/optimized/ef6377y6ghjuldeh7i38ro0v6.ll
94 100 bench/ruff-rs/optimized/epp47kx9uttdtlbdyskfv1oj4.ll
36 57 bench/rust-analyzer-rs/optimized/1r5fg81ha4dpx7ns.ll
33 57 bench/rust-analyzer-rs/optimized/4nrj6o47dqd25wok.ll
17 29 bench/rust-analyzer-rs/optimized/53ntv1pfq7fnns7g.ll
21 36 bench/rust-analyzer-rs/optimized/54f0pj1u367tkav7.ll
48 69 bench/rust-analyzer-rs/optimized/lvm5mow7j40zynh.ll
12 21 bench/typst-rs/optimized/4qskctz4kwc33g7b.ll
36 48 bench/uv-rs/optimized/15s939t8m7fafv9tz90ishb54.ll
9 12 bench/uv-rs/optimized/2fqmnnkeae8bysbb8iccfp4x7.ll
67 73 bench/uv-rs/optimized/3g4y4e5zpasspzcq1olf44v4n.ll
26 32 bench/uv-rs/optimized/45hfrep4ggmfhi01r08vn3ckd.ll
52 64 bench/uv-rs/optimized/bxzewuhfrv4f2985nfoqh8h6m.ll
39 48 bench/uv-rs/optimized/ca7ngjdnsk6rs46p760kp5buc.ll
26 32 bench/uv-rs/optimized/eqqy9j7573wpwfd3u88rhhd6d.ll
18 24 bench/uv-rs/optimized/ez1yaesi7677bm3j3srlzeece.ll
86 149 bench/wasmtime-rs/optimized/5b6rejgre7fzh1ir.ll
35 47 bench/zed-rs/optimized/0eh1fm3h72yjwo2ipis72ui0f.ll
35 47 bench/zed-rs/optimized/2ecowgfjy3v8prrslio5p82gj.ll
33 45 bench/zed-rs/optimized/4j81zvwpo3may7k9k6shk9eiu.ll
14 26 bench/zed-rs/optimized/4pyl8821jbmubnjyx7hxe0q2i.ll
16 25 bench/zed-rs/optimized/7diapbiz116z58qz43ov3nwc9.ll
30 51 bench/zed-rs/optimized/7u7kqrwsc13jj4kea6fu8y45f.ll
16 28 bench/zed-rs/optimized/b8qhlvoy2nskqwvkt99c6cu9u.ll

Copy link
Contributor

github-actions bot commented Jul 9, 2025

Here is a brief summary of up to 5 major changes observed in the provided LLVM IR diffs:

  1. Removal of Overflow Checks with llvm.umul.with.overflow:

    • In several functions (e.g., _ZN8smallvec17SmallVec$LT$A$GT$8try_grow17h...), calls to llvm.umul.with.overflow.i64 have been removed.
    • These were used to check if multiplication operations overflowed when calculating allocation sizes.
    • Replaced with simple mul i64 instructions, reducing complexity and potentially improving performance by eliminating explicit overflow checks.
  2. Replacement of Overflow Checks with Direct Comparisons:

    • Instead of using { extractvalue { i64, i1 } %val, 0/1 }, overflow checks are now performed via direct comparisons like icmp ugt i64 %.sink.i, <constant>.
    • This simplifies the code by avoiding decomposition of struct return values from llvm.umul.with.overflow, while still ensuring correctness or triggering error handling on overflow.
  3. Use of nsw and nuw Flags in Multiplication Instructions:

    • Several mul instructions now include flags such as mul nuw nsw i64, indicating that the multiply operation does not sign-wrap (nsw) or unsigned-wrap (nuw).
    • These flags provide additional optimization opportunities for the compiler by allowing it to assume no wraparound behavior.
  4. Simplified Branch Logic Using samesign Comparison:

    • Some branches previously checked both overflow flag and result value. Now simplified to use icmp samesign ugt i64 which combines size comparison and overflow safety into one instruction.
    • Makes control flow logic more compact and easier for the optimizer to reason about.
  5. Phi Node Adjustments Due to Control Flow Changes:

    • Phi nodes have been adjusted to reflect new control flow paths introduced after branch simplifications.
    • For example, in _ZN9hashbrown3raw13RawTableInner22fallible_with_capacity17h..., phi node inputs and labels have changed due to modified branching logic.

High-Level Overview:

These changes represent an optimization effort to simplify arithmetic overflow checking in memory allocation and resizing routines, especially involving smallvec and hashbrown crates. The replacement of llvm.umul.with.overflow calls with simpler integer comparisons and use of nsw/nuw flags reduces intermediate steps, possibly leading to better runtime efficiency and clearer IR. Phi nodes and branching structures have been updated accordingly to maintain correctness under these transformations.

model: qwen-plus-latest
CompletionUsage(completion_tokens=553, prompt_tokens=117157, total_tokens=117710, completion_tokens_details=None, prompt_tokens_details=None)

@nikic
Copy link

nikic commented Jul 9, 2025

/add-label reviewed
/close

@github-actions github-actions bot closed this Jul 9, 2025
@dtcxzyw dtcxzyw deleted the test-run16178749937 branch July 10, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants