Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Jun 21, 2025

Link: llvm/llvm-project#143683
Requested by: @dtcxzyw

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

zyw-bot commented Jun 21, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@831fcb5
patch: llvm/llvm-project#143683
sha256: 30b1172a4f5a299991caf9eb01a431451bdeb0163792bfd349f5d0798d2e8bf0
commit: b589381

2476 files changed, 674061 insertions(+), 680411 deletions(-)

Improvements:
  simplifycfg.NumSinkCommonInstrs 833617 -> 836143 +0.30%
  correlated-value-propagation.NumCmps 300428 -> 301088 +0.22%
  dse.NumFastOther 517196 -> 517702 +0.10%
  gvn.NumGVNSimpl 4742451 -> 4746841 +0.09%
  simplifycfg.NumSinkCommonCode 388689 -> 389018 +0.08%
  simplifycfg.NumSpeculations 412799 -> 413107 +0.07%
  memory-builtins.ObjectVisitorLoad 2476589 -> 2478369 +0.07%
  dse.NumFastStores 1198813 -> 1199572 +0.06%
  dse.NumGetDomMemoryDefPassed 1409529 -> 1410249 +0.05%
  jump-threading.NumThreads 2949632 -> 2950762 +0.04%
Regressions:
  correlated-value-propagation.NumMinMax 16543 -> 12489 -24.51%
  correlated-value-propagation.NumSaturating 2900 -> 2884 -0.55%
  licm.NumMovedCalls 35499 -> 35333 -0.47%
  simplifycfg.NumHoistCommonCode 859217 -> 858165 -0.12%
  simplifycfg.NumHoistCommonInstrs 2480546 -> 2478052 -0.10%
  correlated-value-propagation.NumSubNUW 39292 -> 39255 -0.09%
  globalsmodref-aa.NumNoMemFunctions 812847 -> 812362 -0.06%
  indvars.NumElimIdentity 1889 -> 1888 -0.05%
  correlated-value-propagation.NumSubNW 122449 -> 122388 -0.05%
  globalsmodref-aa.NumReadMemFunctions 1242553 -> 1242068 -0.04%

1 6 bench/abc/optimized/abcSop.ll
3 5 bench/abc/optimized/absRpm.ll
8 11 bench/abc/optimized/ac_wrapper.ll
1 4 bench/abseil-cpp/optimized/usage.ll
1 5 bench/actix-rs/optimized/comsm606o4zjj7a.ll
37 38 bench/arrow/optimized/arena.ll
1 2 bench/arrow/optimized/exec.ll
9 14 bench/arrow/optimized/key_value_metadata.ll
3 7 bench/boost/optimized/async.ll
2 7 bench/cpython/optimized/hamt.ll
2 6 bench/curl/optimized/mime.ll
4 12 bench/curl/optimized/select.ll
12 18 bench/delta-rs/optimized/43y2svfstmvqcl15.ll
16 19 bench/delta-rs/optimized/4say4x9grcidoih4.ll
4 5 bench/draco/optimized/corner_table.ll
3 9 bench/eastl/optimized/EACallback.ll
6 14 bench/eastl/optimized/TestRandom.ll
24 62 bench/flac/optimized/decode.ll
19 23 bench/freetype/optimized/pshinter.ll
1 3 bench/freetype/optimized/truetype.ll
3 8 bench/freetype/optimized/type1cid.ll
10 20 bench/glslang/optimized/linkValidate.ll
4 6 bench/graphviz/optimized/emit.ll
43 48 bench/graphviz/optimized/triang.ll
56 59 bench/harfbuzz/optimized/hb-ot-cff2-table.ll
26 34 bench/harfbuzz/optimized/hb-static.ll
55 58 bench/harfbuzz/optimized/hb-subset-cff2.ll
16 20 bench/hdf5/optimized/H5Spoint.ll
5 6 bench/hdf5/optimized/h5ls.ll
3 7 bench/hdf5/optimized/h5tools.ll
4 14 bench/hermes/optimized/StringKind.ll
4 7 bench/hermes/optimized/hbc-attribute.ll
2 3 bench/icu/optimized/icuexportdata.ll
34 45 bench/influxdb-rs/optimized/1qfvsl8a7jfomqbf.ll
8 14 bench/jq/optimized/regexec.ll
5 10 bench/libcxx/optimized/valarray.ll
25 41 bench/libevent/optimized/evdns.ll
4 10 bench/libquic/optimized/quic_connection.ll
2 2 bench/libsodium/optimized/aead_aes256gcm_aesni.ll
3 8 bench/lief/optimized/DataDirectory.ll
4 9 bench/lief/optimized/DynamicEntry.ll
5 13 bench/lief/optimized/rsa.ll
12 15 bench/lightgbm/optimized/boosting.ll
2 4 bench/lightgbm/optimized/dcg_calculator.ll
13 17 bench/lightgbm/optimized/gbdt.ll
19 39 bench/lightgbm/optimized/linear_tree_learner.ll
6 11 bench/lightgbm/optimized/metadata.ll
12 20 bench/lightgbm/optimized/objective_function.ll
12 24 bench/lightgbm/optimized/serial_tree_learner.ll
1 1 bench/linux/optimized/mincore.ll
29 33 bench/linux/optimized/virtio_input.ll
5 7 bench/lvgl/optimized/lv_textarea.ll
5 9 bench/meilisearch-rs/optimized/1wnbkg3u8l6dyln4.ll
10 18 bench/meilisearch-rs/optimized/4rtt9oltj0ubuf08.ll
5 10 bench/meshoptimizer/optimized/clusterizer.ll
4 14 bench/minetest/optimized/tool.ll
7 11 bench/mini-lsm-rs/optimized/2j7sj03n10nloiwr.ll
11 12 bench/mini-lsm-rs/optimized/2vbarw74mreksmkr.ll
7 8 bench/mini-lsm-rs/optimized/3l74wehtlfae5jz1.ll
5 9 bench/mold/optimized/icf.cc.X86_64.ll
12 14 bench/nanobind/optimized/nb_func.ll
7 17 bench/ncnn/optimized/concat.ll
5 7 bench/ncnn/optimized/detectionoutput.ll
7 11 bench/ninja/optimized/build_log_perftest.ll
43 44 bench/ockam-rs/optimized/59645ou3p4wsm5oz.ll
6 7 bench/oiio/optimized/exrinput_c.ll
3 4 bench/openblas/optimized/dlarrv.ll
3 6 bench/opencc/optimized/CommandLine.ll
7 13 bench/openexr/optimized/ImfTileOffsets.ll
2 8 bench/openjdk/optimized/g1HeapRegionManager.ll
8 11 bench/openjdk/optimized/p11_convert.ll
7 12 bench/openmpi/optimized/plookup.ll
16 30 bench/openmpi/optimized/pmix_hash.ll
2 7 bench/openssl/optimized/f_string.ll
56 26 bench/openssl/optimized/o_str.ll
15 30 bench/ozz-animation/optimized/animation.ll
11 16 bench/ozz-animation/optimized/animation_optimizer.ll
15 30 bench/pola-rs/optimized/8jp76n2tmi4x2dvxoma5qtaa7.ll
5 15 bench/postgres/optimized/pg_enum.ll
9 18 bench/proj/optimized/singleoperation.ll
21 33 bench/raylib/optimized/rmodels.ll
9 16 bench/raylib/optimized/rtext.ll
5 12 bench/ring-rs/optimized/1ifa1mnaz8f3h6jb.ll
27 46 bench/ruby/optimized/encoding.ll
52 49 bench/ruff-rs/optimized/dv3u0zj1g96ml2orvqzylystz.ll
49 46 bench/rust-analyzer-rs/optimized/2gfo4qfvfsgl8tkl.ll
15 27 bench/rust-analyzer-rs/optimized/rilullg9p294yp1.ll
5 7 bench/sentencepiece/optimized/builder.ll
3 8 bench/slurm/optimized/part_data.ll
8 16 bench/spike/optimized/vl1re16_v.ll
12 23 bench/tev/optimized/Common.ll
5 11 bench/tomlplusplus/optimized/toml.ll
32 44 bench/typst-rs/optimized/1fd2xpfefmgrcb9d.ll
8 10 bench/typst-rs/optimized/3kgmqnxcsl3z3n0n.ll
4 11 bench/typst-rs/optimized/59tuvc5m3xlovl3o.ll
44 45 bench/uv-rs/optimized/4dcxzssfl4exl338cy92tfq1l.ll
45 46 bench/uv-rs/optimized/8hv30atg5watxkzkqbi6e75uu.ll
9 13 bench/verilator/optimized/V3AstNodes.ll
48 92 bench/wasmedge/optimized/compiler.ll
10 21 bench/wasmtime-rs/optimized/2dcgoeji2y2j2nl0.ll
5 13 bench/wasmtime-rs/optimized/6ly84hjssnlljzr.ll
4 10 bench/wireshark/optimized/packet-dhcpv6.ll
8 19 bench/wireshark/optimized/packet-ssh.ll
8 15 bench/wireshark/optimized/packet-thrift.ll
9 15 bench/yoga/optimized/YGNode.ll
20 36 bench/zed-rs/optimized/d31g6vudldcq1cl7b9cowxr8a.ll
3 9 bench/zstd/optimized/fse_decompress.ll
5 10 bench/zxing/optimized/PDFCodewordDecoder.ll

@github-actions
Copy link
Contributor

Here is a brief summary of the major changes in the provided LLVM IR diffs:

  1. Removal of llvm.umax usage and direct use of original values for loop exit conditions
    In several files (e.g., abcSop.ll, absRpm.ll, ac_wrapper.ll, select.ll, pshinter.ll, etc.), calls to llvm.umax.i32 or llvm.umax.i64 are removed. The result of umax was previously used to compute the upper bound for loop iteration counts, but now the original value (often %8, %167, or similar) is directly used instead. This suggests that the code has been optimized by removing unnecessary max-with-1 checks, likely based on the assumption that the original value is already non-zero.

  2. Elimination of redundant zext and umax combinations
    In some cases (e.g., ac_wrapper.ll, key_value_metadata.ll, type1cid.ll, virtio_input.ll), both zext and umax(..., 1) were being applied to the same value. The patch removes the umax call and keeps only the zero extension (zext). This indicates an optimization where the umax was deemed unnecessary, possibly because the input is guaranteed to be at least 1 or because the downstream code can handle zero without it.

  3. Inlining of loop preheader blocks and restructuring of PHI nodes
    Multiple instances show that .preheader blocks have been merged or reordered with their successors, especially involving PHI node updates. For example, in arena.ll, Vec_IntRemove.exit, and 4say4x9grcidoih4.ll, the PHI instructions' incoming block order has been adjusted or simplified. This reflects internal loop structure optimizations, reducing control flow complexity and potentially improving execution efficiency.

  4. Removal of unused declarations and dead function attributes
    Several test files (e.g., curl/optimized/select.ll, hdf5/optimized/H5Spoint.ll, lief/optimized/DynamicEntry.ll) remove unused declarations of @llvm.umax.i32, @llvm.umax.i64, and other intrinsics like @llvm.assume. These functions or declarations were present in the module but not actually used after transformation. Removing them reduces symbol table bloat and simplifies linkage.

  5. Loop unrolling and induction variable reorganization
    Files such as flac/decode.ll, glslang/linkValidate.ll, and lightgbm/serial_tree_learner.ll show significant restructuring of loop bodies. Specifically:

    • Induction variables are updated more efficiently.
    • Loop exits are rewritten using original bounds rather than umax.
    • Some loops are unrolled or structured differently to avoid extra branches.

High-Level Overview

The overall theme of these patches appears to be loop optimization and simplification, particularly around eliminating unnecessary calls to llvm.umax, which computes the unsigned maximum of two integers. These calls were often used to guard against zero when computing trip counts, but in many cases, they were either redundant or could be replaced by simpler logic.

This results in:

  • Improved performance by reducing computation overhead (removing umax).
  • Cleaner IR with fewer intermediate values and reduced PHI node complexity.
  • Better compile-time analysis due to removal of assumptions like llvm.assume(i1) and reliance on natural value constraints.
  • Smaller binary size and less metadata via pruning of unused intrinsic declarations.

These changes likely reflect transformations from the LLVM optimizer passes, such as loop-unroll, simplifycfg, or instcombine, which identified and eliminated redundant safety checks and canonicalized loop structures.

model: qwen-plus-latest
CompletionUsage(completion_tokens=798, prompt_tokens=103824, total_tokens=104622, completion_tokens_details=None, prompt_tokens_details=None)

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