Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

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

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

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

zyw-bot commented Jul 4, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@8f6a964
patch: llvm/llvm-project#146992
sha256: c6924c21fb9af1dbf1b5ebcea82113680e7927f7d1b45b248ca7e5d49acd7082
commit: 83d6eb6

8249 files changed, 6443093 insertions(+), 6439221 deletions(-)

Improvements:
  indvars.NumLFTR 337216 -> 369099 +9.45%
  bdce.NumSExt2ZExt 5465 -> 5680 +3.93%
  correlated-value-propagation.NumSMinMax 9238 -> 9335 +1.05%
  correlated-value-propagation.NumMinMax 12488 -> 12600 +0.90%
  sccp.NumInstReplaced 175650 -> 176410 +0.43%
  local.NumPHICSEs 204984 -> 205618 +0.31%
  instsimplify.NumReassoc 839734 -> 842048 +0.28%
  licm.NumAddSubHoisted 1337 -> 1339 +0.15%
  constmerge.NumIdenticalMerged 15670 -> 15690 +0.13%
  correlated-value-propagation.NumPhiCommon 58391 -> 58428 +0.06%
Regressions:
  correlated-value-propagation.NumSICmps 64544 -> 55829 -13.50%
  loop-load-elim.NumLoopLoadEliminted 1574 -> 1499 -4.76%
  loop-idiom.NumMemMove 217 -> 208 -4.15%
  indvars.NumElimCmp 57979 -> 57350 -1.08%
  licm.NumMinMaxHoisted 778 -> 776 -0.26%
  loop-simplifycfg.NumLoopExitsDeleted 3975 -> 3965 -0.25%
  loop-simplifycfg.NumLoopBlocksDeleted 7092 -> 7077 -0.21%
  loop-simplifycfg.NumTerminatorsFolded 10648 -> 10629 -0.18%
  indvars.NumElimIdentity 1881 -> 1878 -0.16%
  scalar-evolution.NumBruteForceTripCountsComputed 40442 -> 40396 -0.11%

3 2 bench/abc/optimized/abcFanio.ll
6 4 bench/abseil-cpp/optimized/fastmath_test.ll
8 8 bench/actix-rs/optimized/q4aavw6wh20so0r.ll
4 3 bench/assimp/optimized/FindInstancesProcess.ll
5 4 bench/bdwgc/optimized/gc.ll
37 35 bench/box2d/optimized/sample_collision.ll
14 10 bench/box2d/optimized/settings.ll
3 2 bench/casadi/optimized/sundials_spgmr.ll
9 6 bench/cmake/optimized/archive_read_support_format_7zip.ll
14 13 bench/cmake/optimized/archive_read_support_format_rar.ll
8 6 bench/coreutils-rs/optimized/389ib4lq03w39x6a.ll
17 16 bench/cpython/optimized/mathmodule.ll
11 10 bench/csmith/optimized/Variable.ll
3 2 bench/darktable/optimized/bauhaus.ll
30 32 bench/darktable/optimized/curve_tools.ll
12 8 bench/darktable/optimized/fp_dng.ll
3 2 bench/duckdb/optimized/compile.ll
27 16 bench/duckdb/optimized/src_backend_nodes_list.ll
15 13 bench/duckdb/optimized/src_backend_parser_scan.ll
52 67 bench/eastl/optimized/EAScanfCore.ll
11 8 bench/eastl/optimized/EATextUtil.ll
13 8 bench/eastl/optimized/eathread_semaphore.ll
17 20 bench/fish-rs/optimized/8zxt2gjt68ikxu18thf3foa45.ll
9 6 bench/flac/optimized/lpc_intrin_sse2.ll
12 11 bench/freetype/optimized/ftbitmap.ll
11 7 bench/freetype/optimized/raster.ll
13 17 bench/git/optimized/hex.ll
7 5 bench/graphviz/optimized/dtstat.ll
3 2 bench/graphviz/optimized/lu.ll
3 2 bench/graphviz/optimized/visibility.ll
7 5 bench/harfbuzz/optimized/hb-subset-cff1.ll
18 12 bench/hdf5/optimized/H5Centry.ll
12 14 bench/hdf5/optimized/h5tools.ll
10 9 bench/hermes/optimized/Callable.ll
48 33 bench/hermes/optimized/ItaniumDemangle.ll
5 2 bench/hermes/optimized/MicrosoftDemangle.ll
16 15 bench/hermes/optimized/RegexParser.ll
24 19 bench/jq/optimized/decNumber.ll
28 27 bench/jq/optimized/regparse.ll
16 15 bench/jsonnet/optimized/formatter.ll
9 9 bench/just-rs/optimized/4mdvpwvrpdu4jonv.ll
7 6 bench/libjpeg-turbo/optimized/jdphuff.ll
37 28 bench/libpng/optimized/png.ll
12 8 bench/libquic/optimized/pcy_tree.ll
9 6 bench/libquic/optimized/shift.ll
8 6 bench/libquic/optimized/url_canon_ip.ll
19 14 bench/libwebp/optimized/alpha_processing.ll
9 6 bench/libwebp/optimized/backward_references_enc.ll
6 5 bench/lightgbm/optimized/sample_strategy.ll
2 3 bench/linux/optimized/drm_gem_framebuffer_helper.ll
8 4 bench/linux/optimized/sg.ll
9 8 bench/llvm/optimized/LoadStoreOpt.ll
11 12 bench/llvm/optimized/MicrosoftDemangle.ll
13 12 bench/lua/optimized/llex.ll
8 7 bench/lua/optimized/ltablib.ll
17 11 bench/lua/optimized/lutf8lib.ll
3 2 bench/lvgl/optimized/lv_buttonmatrix.ll
8 7 bench/lvgl/optimized/lv_draw_sw_mask.ll
17 16 bench/lvgl/optimized/lv_spinbox.ll
19 18 bench/lz4/optimized/lz4hc.ll
29 39 bench/meilisearch-rs/optimized/1bqqlm3jtb9rf3cv.ll
25 28 bench/meshlab/optimized/filter_color_projection.ll
9 8 bench/minetest/optimized/mapgen.ll
9 7 bench/mitsuba3/optimized/rgb2spec_opt.ll
4 3 bench/msdfgen/optimized/Contour.ll
15 10 bench/ncnn/optimized/caffe.pb.ll
4 3 bench/ncnn/optimized/cpu.ll
18 14 bench/ncnn/optimized/ncnnoptimize.ll
2 2 bench/nix/optimized/app.ll
20 16 bench/nuttx/optimized/lib_libvsprintf.ll
8 9 bench/ocio/optimized/Lut1DOpData.ll
6 5 bench/ocio/optimized/Lut3DOpCPU.ll
7 7 bench/ockam-rs/optimized/2m830wtqeyaos7wt.ll
13 11 bench/openblas/optimized/dlalsa.ll
8 6 bench/openblas/optimized/dlasrt.ll
5 4 bench/openexr/optimized/internal_dwa.ll
6 4 bench/openmpi/optimized/pmix_argv.ll
28 21 bench/openspiel/optimized/backgammon.ll
4 3 bench/openspiel/optimized/rbc.ll
7 5 bench/openusd/optimized/patchBuilder.ll
6 4 bench/openusd/optimized/topologyDescriptor.ll
9 8 bench/ozz-animation/optimized/animation_optimizer.ll
44 39 bench/ozz-animation/optimized/jsoncpp.ll
12 8 bench/pbrt-v4/optimized/integrators.ll
18 12 bench/php/optimized/plain_wrapper.ll
3 2 bench/php/optimized/zend_ssa.ll
3 2 bench/proj/optimized/pipeline.ll
13 5 bench/protobuf/optimized/unknown_field_set.ll
5 4 bench/protobuf/optimized/zero_copy_stream_impl_lite.ll
3 2 bench/proxygen/optimized/HTTPHeaders.ll
14 11 bench/raylib/optimized/rmodels.ll
3 2 bench/re2/optimized/compile.ll
10 9 bench/re2/optimized/simplify.ll
6 4 bench/recastnavigation/optimized/DetourTileCache.ll
19 9 bench/redis/optimized/linenoise.ll
3 2 bench/redis/optimized/lvm.ll
5 3 bench/rocksdb/optimized/pessimistic_transaction.ll
13 8 bench/ruby/optimized/date_core.ll
4 3 bench/ruff-rs/optimized/abz4enoi74elfoplai1nrzl05.ll
10 8 bench/rust-analyzer-rs/optimized/4wjr9n8d5oomu43d.ll
9 4 bench/slurm/optimized/affinity.ll
7 5 bench/slurm/optimized/node_scheduler.ll
45 40 bench/stb/optimized/stb_tilemap_editor.ll
3 4 bench/wireshark/optimized/packet-signal-pdu.ll
5 3 bench/wireshark/optimized/tvbuff_lz77huff.ll
4 3 bench/yalantinglibs/optimized/test_messages_proto2.pb.ll
22 14 bench/yosys/optimized/preproc.ll
12 9 bench/z3/optimized/lar_solver.ll
23 33 bench/zed-rs/optimized/1cwzjnrfv3j054rlb5kbvkj4j.ll
21 31 bench/zed-rs/optimized/2qu3ksqe5t2g2a0ursek881ws.ll
23 32 bench/zed-rs/optimized/4h84anocrn0e2zexjpu5utgbx.ll
3 3 bench/zxing/optimized/ODDataBarExpandedBitDecoder.ll

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

Here is a high-level summary of the major changes in the provided LLVM IR diff:

  1. Loop Condition Replacement Using Bitwise AND and ICMP EQ
    Several loops previously used icmp sgt or icmp ugt with sign checks (samesign) to compare induction variables against bounds. These have been replaced with a combination of and i64 ..., 4294967295 (which masks the higher bits, effectively treating the value as a 32-bit unsigned integer) followed by icmp eq. This change likely reflects a transformation for more efficient loop exit condition checking, possibly due to improved range analysis or optimization of signed/unsigned comparisons.

  2. Induction Variable PHI Updates
    In several functions, notably in box2d, eastl, and libquic, the PHI nodes in loop exits were updated to reflect new variable definitions tied to loop control. Some PHIs that previously tracked values like %indvars.iv now track bit-manipulated or truncated versions (e.g., %wide.trip.count, %lftr.wideiv, or %exitcond). This indicates restructuring of how trip counts or current indices are maintained at loop boundaries.

  3. Elimination of Dead Code and Unused Labels
    Several .preheader labels and unused intermediate blocks such as _ZN...split.loop.exit and _crit_edge.thread were removed or reordered. Additionally, some redundant phi entries and unreachable branches were simplified. These changes suggest dead code elimination and cleanup of unnecessary control flow constructs after loop optimizations.

  4. Improved Memory Access Patterns
    In functions like coreutils-rs, libwebp, and darktable, there are updates to memory access patterns involving GEP (getelementptr), load, and store instructions. For example, pointer arithmetic was adjusted to use nuw (no unsigned wrap) and nsw (no signed wrap) flags, indicating better-defined behavior and potential vectorization opportunities.

  5. Function Attribute Additions and Declarations
    New declarations for intrinsic functions such as @llvm.smin.i32, @llvm.smax.i32, and @llvm.smin.i64 were added in multiple benchmarks (freetype, hermes, eastl, etc.). These intrinsics are used to optimize min/max logic in loops and conditional branches. Function attributes like nocallback, nofree, nosync, speculatable, and willreturn were also added or refined in certain function declarations, allowing further interprocedural optimizations.

Overall, these transformations represent low-level loop optimizations including:

  • Loop exit condition simplification using bitmasking and equality checks
  • Induction variable cleanup and propagation
  • Removal of dead control flow
  • Improved memory accesses
  • Use of more precise intrinsics for comparison logic

They aim to reduce branch complexity, improve dataflow clarity, and enable better code generation during later passes.

model: qwen-plus-latest
CompletionUsage(completion_tokens=617, prompt_tokens=106748, total_tokens=107365, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Aug 2, 2025
@dtcxzyw dtcxzyw deleted the test-run16071117415 branch August 2, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants