Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Sep 8, 2025

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

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

zyw-bot commented Sep 8, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@193df2a
patch: llvm/llvm-project#151333
sha256: 2710f70598b4d78aaa08561460754d64a33cb30217825f453ef53bdd6499baa7
commit: 075cdbe

8825 files changed, 13051168 insertions(+), 12915993 deletions(-)

Improvements:
  basicaa.SearchLimitReached 4536 -> 4771 +5.18%
  licm.NumSunk 276246 -> 278873 +0.95%
  bdce.NumRemoved 386525 -> 388121 +0.41%
  gvn.NumGVNEqProp 442465 -> 443536 +0.24%
  licm.NumGEPsHoisted 24057 -> 24110 +0.22%
  dse.NumFastOther 509598 -> 510521 +0.18%
  dse.NumFastStores 1145947 -> 1147686 +0.15%
  instsimplify.NumReassoc 828133 -> 829207 +0.13%
  gvn.NumPRELoad 978041 -> 979224 +0.12%
  early-cse.NumCSEGEP 13641628 -> 13656409 +0.11%
Regressions:
  loop-simplifycfg.NumLoopBlocksDeleted 6987 -> 6938 -0.70%
  instcombine.NumDeadInst 42521380 -> 42458047 -0.15%
  loop-simplifycfg.NumTerminatorsFolded 10793 -> 10778 -0.14%
  local.NumPHICSEs 198909 -> 198649 -0.13%
  correlated-value-propagation.NumShlNUW 155621 -> 155511 -0.07%
  simplifycfg.NumInvokeSetsFormed 54668 -> 54630 -0.07%
  simplifycfg.NumInvokesMerged 148499 -> 148422 -0.05%
  simple-loop-unswitch.NumSwitches 1966 -> 1965 -0.05%
  instcombine.NumCombined 125670365 -> 125616389 -0.04%
  simple-loop-unswitch.NumSelects 2609 -> 2608 -0.04%

6 3 bench/abc/optimized/giaTtopt.ll
11 10 bench/abseil-cpp/optimized/gmock-all.ll
11 10 bench/actix-rs/optimized/4zcw438fefceam0r.ll
36 30 bench/actix-rs/optimized/d7z2ueos8qkfuul.ll
1 2 bench/assimp/optimized/AMFImporter_Postprocess.ll
7 8 bench/assimp/optimized/Importer.ll
63 73 bench/bdwgc/optimized/cordbscs.ll
21 18 bench/boost/optimized/pool_resource.ll
7 6 bench/boost/optimized/to_chars.ll
7 9 bench/box2d/optimized/linux_joystick.ll
5 4 bench/box2d/optimized/wl_monitor.ll
10 8 bench/bullet3/optimized/btMultiBodyFixedConstraint.ll
3 2 bench/bullet3/optimized/btTriangleIndexVertexArray.ll
5 4 bench/c3c/optimized/llvm_codegen.ll
8 7 bench/c3c/optimized/sema_casts.ll
5 4 bench/c3c/optimized/symtab.ll
9 8 bench/casadi/optimized/rootfinder.ll
6 5 bench/casadi/optimized/tinyxml2.ll
25 23 bench/ceres/optimized/block_random_access_dense_matrix.ll
4 3 bench/clamav/optimized/output.ll
10 9 bench/clap-rs/optimized/28kpmq8k0hu4re4f.ll
6 5 bench/cmake/optimized/uv-common.ll
4 8 bench/cmake/optimized/zstd_decompress_block.ll
16 13 bench/coreutils-rs/optimized/2145dndjkhee8wnm.ll
4 5 bench/coreutils-rs/optimized/2wc2yx8ferzqfnf3.ll
4 6 bench/cpython/optimized/gcmodule.ll
22 21 bench/cvc5/optimized/minisat.ll
14 13 bench/cvc5/optimized/node_manager.ll
1 2 bench/darktable/optimized/AbstractLJpegDecoder.ll
30 27 bench/delta-rs/optimized/11w0at10aiwuq3yr.ll
10 8 bench/delta-rs/optimized/3e84m8xk6w9g4bb2.ll
5 4 bench/diesel-rs/optimized/3btvyztn2iiarpvf.ll
15 12 bench/eastl/optimized/BenchmarkSort.ll
2 1 bench/eastl/optimized/TestIntrusiveHash.ll
3 2 bench/egg-rs/optimized/1m5ocab1mrcx5l24.ll
34 35 bench/elfshaker-rs/optimized/3a1f053714hdbf2r1u9m19s6u.ll
12 10 bench/elfshaker-rs/optimized/9f70t9k6da07jnr9o42fbjzc5.ll
16 15 bench/entt/optimized/group.ll
9 8 bench/faiss/optimized/MatrixStats.ll
14 13 bench/fish-rs/optimized/czs708r0zvy58e2j6rsq7a88i.ll
16 14 bench/fish-rs/optimized/e69mx4kebbw5h90l2bpw0bwyt.ll
2 3 bench/flac/optimized/utils.ll
11 10 bench/fmt/optimized/gmock-gtest-all.ll
48 44 bench/folly/optimized/EventBase.ll
21 19 bench/foundations-rs/optimized/208outlkq19x3hykb3fof84u4.ll
8 4 bench/foundations-rs/optimized/dh385e1vps3pv71hnt480a6fj.ll
10 8 bench/freetype/optimized/cff.ll
16 14 bench/g2o/optimized/marginal_covariance_cholesky.ll
16 15 bench/g2o/optimized/vertex_ellipse.ll
4 3 bench/graphviz/optimized/dotinit.ll
22 19 bench/graphviz/optimized/heap.ll
15 12 bench/graphviz/optimized/sgraph.ll
13 12 bench/gromacs/optimized/parrinellorahmanbarostat.ll
10 8 bench/harfbuzz/optimized/hb-ot-cff1-table.ll
20 19 bench/hdf5/optimized/H5FSdbg.ll
6 5 bench/hdf5/optimized/H5SMtest.ll
10 8 bench/html5ever-rs/optimized/2p0p1zz6gwjy9c4w.ll
15 12 bench/html5ever-rs/optimized/2smemja2l5hlqxk7.ll
34 33 bench/hwloc/optimized/hwloc-annotate.ll
18 17 bench/hwloc/optimized/hwloc-ps.ll
2 4 bench/hyperscan/optimized/tamarama.ll
22 23 bench/imgui/optimized/imgui_demo.ll
11 13 bench/influxdb-rs/optimized/3k3vgyqcou07q2z6.ll
10 12 bench/influxdb-rs/optimized/u7z03ejdn0bs7a8.ll
13 11 bench/just-rs/optimized/3022oi333lxf39jd.ll
5 10 bench/lean4/optimized/static.ll
30 28 bench/libevent/optimized/buffer.ll
10 9 bench/libigl/optimized/ViewerData.ll
54 50 bench/libjpeg-turbo/optimized/rdswitch.ll
6 4 bench/libquic/optimized/activity_tracker.ll
13 10 bench/libquic/optimized/err.ll
15 13 bench/libquic/optimized/heap_profiler_allocation_context.ll
11 9 bench/libwebp/optimized/muxinternal.ll
9 7 bench/libwebp/optimized/muxread.ll
2 3 bench/lief/optimized/oid.ll
6 5 bench/lief/optimized/psa_util.ll
45 43 bench/llama.cpp/optimized/log.ll
6 4 bench/lua/optimized/ltm.ll
33 32 bench/luajit/optimized/lib_ffi.ll
35 32 bench/luajit/optimized/lj_opt_loop.ll
8 7 bench/meilisearch-rs/optimized/3m3x2x3yg1gvj93u.ll
25 23 bench/mini-lsm-rs/optimized/211qm7emy1a6xqse.ll
15 12 bench/mitsuba3/optimized/x86rapass.ll
2 4 bench/mold/optimized/thread_dispatcher.ll
12 6 bench/msdfgen/optimized/Scanline.ll
10 9 bench/nghttp2/optimized/nghttp2_frame.ll
49 46 bench/nghttp2/optimized/nghttp2_map.ll
17 16 bench/ninja/optimized/subprocess-posix.ll
5 4 bench/nix/optimized/add-to-store.ll
53 49 bench/nuttx/optimized/lib_memoryregion.ll
7 5 bench/ockam-rs/optimized/1u7cc2g6nvmoyh9z.ll
6 3 bench/ockam-rs/optimized/32cbw7iiw6inrqgd.ll
15 13 bench/open3d/optimized/PinholeCameraTrajectory.ll
15 12 bench/openexr/optimized/ImfCompression.ll
10 8 bench/openmpi/optimized/psquash_flex128.ll
3 5 bench/openssl/optimized/filterprov.ll
8 6 bench/openusd/optimized/entropymode.ll
4 2 bench/openvdb/optimized/AttributeSet.ll
32 16 bench/openvdb/optimized/FindActiveValues.ll
16 13 bench/openvdb/optimized/Queue.ll
60 55 bench/ozz-animation/optimized/raw_track.ll
6 5 bench/pbrt-v4/optimized/image.ll
34 36 bench/pbrt-v4/optimized/scene.ll
6 7 bench/pola-rs/optimized/3x54p4wb06gbq1xatuv6m3z64.ll
62 65 bench/portaudio/optimized/pa_linux_pulseaudio.ll
11 8 bench/proxygen/optimized/HPACKCodec.ll
10 6 bench/proxygen/optimized/HTTP2PriorityQueue.ll
15 13 bench/qdrant-rs/optimized/56pxyf4u4f2wpi3v.ll
18 17 bench/qemu/optimized/fdt_ro.ll
5 4 bench/quiche-rs/optimized/6lp2oyapnsojevo64mk9ap806.ll
48 45 bench/rayon-rs/optimized/5ev50in5ju1pej99.ll
51 49 bench/recastnavigation/optimized/Sample_TempObstacles.ll
5 7 bench/redis/optimized/latency.ll
11 14 bench/redis/optimized/lvm.ll
12 22 bench/redis/optimized/redis-check-aof.ll
28 26 bench/ripgrep-rs/optimized/5ckxrdy9v0i8g3uf.ll
7 9 bench/ruby/optimized/file.ll
25 23 bench/ruby/optimized/re.ll
5 8 bench/rust-analyzer-rs/optimized/4yvp88cqyyaanzkc.ll
4 2 bench/rustfmt-rs/optimized/3n0n7c4xrusd0kzl.ll
37 35 bench/salsa-rs/optimized/0re58vbodfo9fw2ucr33a7vsy.ll
9 7 bench/sdl/optimized/SDL_hidapihaptic_lg4ff.ll
4 3 bench/sdl/optimized/SDL_keysym_to_keycode.ll
15 14 bench/sentencepiece/optimized/bpe_model_trainer.ll
7 6 bench/smol-rs/optimized/45vbdutx5dtz1hlf.ll
19 16 bench/stb/optimized/stb_include.ll
26 24 bench/stockfish/optimized/position.ll
20 18 bench/tls-rs/optimized/7y9936vu35zt2sp.ll
54 48 bench/tokenizers-rs/optimized/10h1ju7dwsvagf79.ll
10 7 bench/tokio-rs/optimized/r9h5225tdo2hxm6.ll
5 4 bench/tree-sitter-rs/optimized/s186efq8x74ief6.ll
26 22 bench/typst-rs/optimized/4m3ebbqd1xx21e5m.ll
2 3 bench/uv-rs/optimized/b1g2y9imcx7brty5xgizhygb8.ll
38 37 bench/verilator/optimized/V3Delayed.ll
25 21 bench/verilator/optimized/V3Subst.ll
15 14 bench/wasmedge/optimized/argument_parser.ll
20 18 bench/wasmi-rs/optimized/3em73trntqi993rygef50yj09.ll
19 18 bench/wasmtime-rs/optimized/4qgt4edt0wnnlcua.ll
22 15 bench/yalantinglibs/optimized/binary_json_conformance_suite.ll
26 13 bench/yalantinglibs/optimized/test_messages_proto2.pb.ll
9 6 bench/yara-x-rs/optimized/7cv7ebacjy921ionh0ccv0p6y.ll
10 8 bench/yara-x-rs/optimized/aqllqyzrtxqplivthssual6c8.ll
12 10 bench/yosys/optimized/abc9_exe.ll
9 8 bench/yosys/optimized/verilog_lexer.ll
3 6 bench/zed-rs/optimized/18fe87pvcvcmccnycfh7q0atj.ll
23 38 bench/zstd/optimized/huf_compress.ll
8 16 bench/zstd/optimized/zstd_decompress_block.ll
3 5 bench/zstd/optimized/zstd_v04.ll

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

The changes primarily involve modifications to getelementptr (GEP) instructions across multiple benchmarks, improving memory access patterns. Key changes include:

  1. Simplified GEP chains: Multiple consecutive GEPs with struct field indexing are replaced by a single GEP followed by an i8 offset calculation. This reduces instruction count and improves readability of pointer arithmetic.

  2. Improved memory access: Several instances replace multi-level struct indexing (e.g., i32 0, i32 0, i32 0, i32 1) with direct byte offsets using i8 pointers, making the code more efficient and easier to optimize.

  3. Fixes in pointer arithmetic: Corrections in pointer calculations, particularly in loops that traverse arrays of structs, where proper element sizing is now used instead of manual offset calculations.

  4. Optimized struct field access: Direct access to struct fields using computed byte offsets rather than nested GEP operations, reducing complexity and potential for errors.

  5. Consistent pattern application: The same optimization pattern is applied across numerous functions and benchmarks, suggesting a systematic improvement in how struct member accesses are lowered to LLVM IR.

These changes represent a low-level optimization that simplifies pointer arithmetic while maintaining semantic equivalence, potentially improving both compilation efficiency and runtime performance through better optimization opportunities.

model: qwen-plus-latest
CompletionUsage(completion_tokens=272, prompt_tokens=110094, total_tokens=110366, completion_tokens_details=None, prompt_tokens_details=None)

store i8 0, ptr %91, align 1
%92 = getelementptr inbounds nuw %struct.aiMetadataEntry, ptr %79, i64 %66, i32 1
store ptr %89, ptr %92, align 8
store ptr %89, ptr %81, align 8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Various CSE improvements like this.

%48 = getelementptr inbounds nuw %"class.std::vector.85", ptr %47, i64 %.015121
%49 = load ptr, ptr %48, align 8, !tbaa !287
%50 = getelementptr inbounds nuw %"class.std::vector.85", ptr %47, i64 %.015121, i32 0, i32 0, i32 0, i32 1
%50 = getelementptr inbounds nuw i8, ptr %48, i64 8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also like this, where the common base is CSEd.

%.idx.i = mul nsw i64 %12, 24
%13 = getelementptr i8, ptr %9, i64 %.idx.i
%14 = getelementptr i8, ptr %13, i64 20
%13 = getelementptr %struct.gc_generation, ptr %9, i64 %12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer performing ptradd canonicalization in some cases, presumably because https://github.com/llvm/llvm-project/blob/1bd3cc26685636b112d075fd46b20fa0b2e6859f/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp#L3077-L3084 no longer applies. This is ok for now.

@nikic
Copy link

nikic commented Sep 8, 2025

/add-label reviewed
/close

@github-actions github-actions bot closed this Sep 8, 2025
@dtcxzyw dtcxzyw deleted the test-run17544164294 branch September 9, 2025 15:33
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