Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

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

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

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

zyw-bot commented Jul 1, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@650d015
patch: llvm/llvm-project#144065
sha256: febd19919cec5f9acbf643cd5b155110e760b65e7454ebc15e2aa0fc1eba14dd
commit: 9ca17b7

1681 files changed, 712495 insertions(+), 715470 deletions(-)

Improvements:
  instcombine.NegatorNumTreesNegated 51862 -> 52534 +1.30%
  instcombine.NegatorNumInstructionsNegatedSuccess 63666 -> 64338 +1.06%
  instcombine.NegatorNumInstructionsCreatedTotal 68760 -> 69432 +0.98%
  licm.NumAddSubHoisted 1316 -> 1325 +0.68%
  instcombine.NumFactor 46953 -> 47017 +0.14%
  basicaa.SearchLimitReached 5083 -> 5088 +0.10%
  local.NumPHICSEs 204882 -> 204984 +0.05%
  instcombine.NumSunkInst 3562660 -> 3564252 +0.04%
  adce.NumRemoved 102923 -> 102959 +0.03%
  instcombine.NegatorMaxInstructionsCreated 17167 -> 17173 +0.03%
Regressions:
  licm.NumGEPsHoisted 61468 -> 61079 -0.63%
  loop-simplifycfg.NumTerminatorsFolded 10655 -> 10648 -0.07%
  indvars.NumReplaced 73047 -> 73001 -0.06%
  simplifycfg.NumHoistCommonCode 857029 -> 856677 -0.04%
  loop-delete.NumBackedgesBroken 46244 -> 46226 -0.04%
  instsimplify.NumReassoc 839357 -> 839061 -0.04%
  gvn.NumGVNEqProp 456639 -> 456549 -0.02%
  gvn.NumGVNBlocks 200171 -> 200139 -0.02%
  simplifycfg.NumHoistCommonInstrs 2477150 -> 2476798 -0.01%
  sccp.NumDeadBlocks 755727 -> 755639 -0.01%

5 6 bench/abc/optimized/giaDup.ll
6 2 bench/abc/optimized/giaTransduction.ll
20 19 bench/abseil-cpp/optimized/gtest-all.ll
3 3 bench/actix-rs/optimized/5k5ycrtlwwxldg7.ll
48 80 bench/arrow/optimized/coo_converter.ll
11 17 bench/arrow/optimized/csf_converter.ll
12 13 bench/arrow/optimized/reader.ll
2 4 bench/assimp/optimized/BaseImporter.ll
29 24 bench/assimp/optimized/IFCOpenings.ll
25 27 bench/bdwgc/optimized/gc.ll
24 15 bench/boost/optimized/instantiate_cpp_grammar.ll
8 5 bench/boost/optimized/instantiate_re2c_lexer.ll
2 2 bench/box2d/optimized/imgui.ll
7 12 bench/casadi/optimized/fmu2.ll
13 15 bench/ceres/optimized/covariance_impl.ll
34 38 bench/ceres/optimized/eigensparse.ll
9 5 bench/clamav/optimized/entconv.ll
8 6 bench/clamav/optimized/htmlnorm.ll
23 16 bench/clamav/optimized/mbox.ll
18 16 bench/clamav/optimized/msdoc.ll
4 6 bench/cmake/optimized/archive_read_support_format_zip.ll
9 13 bench/cmake/optimized/cmList.ll
6 5 bench/cmake/optimized/cmListFileLexer.ll
11 9 bench/coreutils-rs/optimized/4jcegsvljtrqsq46.ll
17 18 bench/csmith/optimized/CGContext.ll
6 6 bench/darktable/optimized/exif.ll
5 4 bench/darktable/optimized/imageop_math.ll
7 9 bench/darktable/optimized/piwigo.ll
16 12 bench/eastl/optimized/BenchmarkAlgorithm.ll
2 1 bench/eastl/optimized/EAMemory.ll
39 30 bench/eastl/optimized/EAString.ll
12 12 bench/elfshaker-rs/optimized/538k7v4jnxs1qgfredr4viqv4.ll
3 2 bench/elfshaker-rs/optimized/9g25xiovadbzz8leri5a9ttiq.ll
4 5 bench/entt/optimized/storage.ll
6 5 bench/ffmpeg/optimized/rtpenc_aac.ll
48 39 bench/ffmpeg/optimized/rtpenc_amr.ll
9 6 bench/fish-rs/optimized/87c4l3sw5gd0mi55puarpe5kb.ll
4 3 bench/fmt/optimized/enforce-checks-test.ll
6 8 bench/folly/optimized/CacheLocality.ll
18 10 bench/freetype/optimized/ftbase.ll
17 19 bench/g2o/optimized/slam2d_linear.ll
30 35 bench/git/optimized/apply.ll
41 51 bench/git/optimized/packfile.ll
4 4 bench/graphviz/optimized/dtstrhash.ll
6 8 bench/gromacs/optimized/neldermead.ll
7 11 bench/grpc/optimized/channel_stack.ll
33 37 bench/grpc/optimized/work_serializer.ll
10 12 bench/hdf5/optimized/H5Odrvinfo.ll
11 15 bench/hdf5/optimized/H5Orefcount.ll
43 47 bench/hdf5/optimized/H5Oshmesg.ll
19 36 bench/hdf5/optimized/H5T.ll
12 11 bench/hermes/optimized/DependencyExtractor.ll
4 14 bench/hermes/optimized/HandleRootOwner.ll
8 7 bench/hermes/optimized/Operations.ll
12 13 bench/hyperscan/optimized/mpv.ll
5 5 bench/hyperscan/optimized/ng_violet.ll
14 11 bench/icu/optimized/collationiterator.ll
12 9 bench/icu/optimized/ufmt_cmn.ll
31 32 bench/icu/optimized/unistr.ll
9 7 bench/icu/optimized/ustring.ll
22 28 bench/jemalloc/optimized/extent_dss.ll
7 7 bench/jq/optimized/decNumber.ll
11 10 bench/lean4/optimized/llnf.ll
1 1 bench/libcxx/optimized/cxa_demangle.ll
17 16 bench/libigl/optimized/sort.ll
44 43 bench/libquic/optimized/dtoa.ll
9 9 bench/libquic/optimized/fd.ll
16 12 bench/libwebp/optimized/backward_references_cost_enc.ll
19 18 bench/lief/optimized/rsa.ll
7 4 bench/llvm/optimized/ConstantFold.ll
7 3 bench/meshlab/optimized/filter_voronoi.ll
4 5 bench/minetest/optimized/guiFormSpecMenu.ll
19 17 bench/mini-lsm-rs/optimized/4c6shhrwpfde8fun.ll
36 42 bench/nanobind/optimized/test_eigen.ll
7 12 bench/nori/optimized/chi2test.ll
17 16 bench/opencc/optimized/louds-trie.ll
3 1 bench/opencv/optimized/core_detect.ll
6 10 bench/opencv/optimized/face_detection_mtcnn.ll
3 4 bench/opencv/optimized/solvepnp.ll
2 1 bench/openjdk/optimized/attachListener_posix.ll
20 17 bench/openjdk/optimized/macro.ll
17 15 bench/openjdk/optimized/node.ll
14 8 bench/openjdk/optimized/output.ll
26 20 bench/openjdk/optimized/split_if.ll
9 15 bench/openspiel/optimized/matrix_game.ll
1 3 bench/php/optimized/cdf.ll
8 7 bench/php/optimized/string.ll
6 4 bench/php/optimized/zend_generators.ll
28 23 bench/php/optimized/zend_opcode.ll
47 46 bench/php/optimized/zend_strtod.ll
60 57 bench/pocketpy/optimized/pocketpy.ll
6 4 bench/pola-rs/optimized/00p9yq8dlhxh4oh7g0hq00qlb.ll
2 4 bench/postgres/optimized/oracle_compat.ll
8 17 bench/proxygen/optimized/RendezvousHash.ll
34 36 bench/qemu/optimized/fdt_rw.ll
12 20 bench/quantlib/optimized/cmsmarketcalibration.ll
8 12 bench/quantlib/optimized/expm.ll
15 11 bench/quantlib/optimized/localvolrndcalculator.ll
4 4 bench/quickjs/optimized/cutils.ll
76 64 bench/quickjs/optimized/quickjs.ll
27 19 bench/raylib/optimized/rtextures.ll
7 7 bench/re2/optimized/prog.ll
13 12 bench/redis/optimized/sds.ll
19 24 bench/regex-rs/optimized/1pxsmct4oxs5dlep.ll
27 31 bench/ruff-rs/optimized/4a0sesc153a050u04do7llz00.ll
16 11 bench/ruff-rs/optimized/e2ejosr9keyhzyna9ksx8o1ej.ll
13 14 bench/snappy/optimized/snappy.ll
7 8 bench/sqlite/optimized/sqlite3.ll
19 18 bench/stockfish/optimized/tbprobe.ll
7 6 bench/uv-rs/optimized/7wzqespkqx248txtmpcrs3fq7.ll
38 44 bench/uv-rs/optimized/bt5f6f08hvtjlcji6qu3dcjek.ll
7 13 bench/velox/optimized/BaseVector.ll
13 18 bench/velox/optimized/ComplexVector.ll
10 6 bench/velox/optimized/Filter.ll
16 29 bench/velox/optimized/Map.ll
99 98 bench/wasmedge/optimized/compiler.ll
39 40 bench/wasmtime-rs/optimized/3r0osxvwe4cd326n.ll
40 38 bench/xgboost/optimized/auc.ll
18 17 bench/z3/optimized/polynomial.ll
14 18 bench/zed-rs/optimized/axq0fnk57nrkchega3zj2zynp.ll
6 6 bench/zstd/optimized/zstd_double_fast.ll
5 3 bench/zxing/optimized/ODCode128Reader.ll
5 3 bench/zxing/optimized/ODCode39Reader.ll

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2025

Here is a high-level summary of the most significant changes in the provided LLVM IR diffs:

  1. Simplification of GEP and ICMP Instructions
    In giaDup.ll, the original code used a struct-based GEP to access elements, while the new version simplifies this by using byte-level pointer arithmetic with mul and getelementptr directly on an i8 base type. This change avoids complex struct-GEP handling and replaces it with simpler offset calculations.

  2. Optimized Pointer Equality Checks
    In several files (e.g., giaTransduction.ll, reader.ll, arrow/optimized/*.ll), pointer equality comparisons (icmp eq ptr) have been replaced with integer comparisons after computing the difference or index. For example:

    • Old: %92 = icmp eq ptr %93, %.val75
    • New: %92 = icmp eq i64 %91, %88
      These transformations reduce reliance on pointer comparisons, which may not optimize well in some backends, favoring integer-based checks that are easier for the optimizer to reason about and vectorize.
  3. Reduction of PHI Nodes and Loop Structure Changes
    Several loops were modified to simplify their PHIs and preheader logic. For instance:

    • Some .preheader blocks now unconditionally branch to .lr.ph.i without needing extra phi entries.
    • PHI operands were reduced by removing redundant predecessors or consolidating branches.
      This results in cleaner loop structures and potentially better loop unrolling and vectorization opportunities.
  4. Elimination of Unnecessary Loads and Stores
    Across multiple diffs (e.g., coo_converter.ll, csf_converter.ll, fmt/enforce-checks-test.ll), intermediate loads from pointers like %53 = load ptr, ptr %50 followed by stores to similar locations were removed. Instead, values are passed directly between blocks using .sink or simplified phi nodes, reducing memory traffic and improving register allocation.

  5. Improved Integer Overflow and Bounds Checking
    Files like coreutils-rs/optimized/4jcegsvljtrqsq46.ll and git/packfile.ll show improved handling of size and offset comparisons. The old pattern used pointer comparisons (icmp ult ptr) to detect underflow or bounds, but these were replaced with sign-aware integer checks:

    • Old: %.not = icmp ult ptr %0, %9
    • New: %.not = icmp sgt i64 %1, 1
      This improves clarity and correctness when checking for valid ranges, especially across platforms where pointer math might behave differently.

These changes reflect a consistent effort to simplify pointer arithmetic, reduce unnecessary memory operations, improve loop structure, and replace pointer comparisons with more portable and analyzable integer-based logic. The overall goal appears to be better optimization opportunities and backend compatibility.

model: qwen-plus-latest
CompletionUsage(completion_tokens=611, prompt_tokens=106343, total_tokens=106954, completion_tokens_details=None, prompt_tokens_details=None)

%64 = trunc i64 %59 to i32
%65 = and i32 %64, 63
%.not.i.i.i = icmp eq ptr %1, %storemerge.i.i.i76
%.not.i.i.i = icmp eq i64 %.idx, %storemerge.idx.i.i.i75.neg
Copy link
Owner

Choose a reason for hiding this comment

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

Missing fold.

Copy link

Choose a reason for hiding this comment

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

@dtcxzyw dtcxzyw closed this Jul 2, 2025
@dtcxzyw dtcxzyw deleted the test-run16009667081 branch July 10, 2025 10:40
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.

3 participants