Skip to content

pre-commit: PR130504 #2199

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

pre-commit: PR130504 #2199

wants to merge 3 commits into from

Conversation

dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Mar 9, 2025

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

@github-actions github-actions bot mentioned this pull request Mar 9, 2025
@dtcxzyw
Copy link
Owner Author

dtcxzyw commented Mar 9, 2025

Diff mode

runner: ariselab-64c-v2
baseline: llvm/llvm-project@2317a72
patch: llvm/llvm-project#130504
sha256: e7470bd6df1b720810b6d71c6fc5e036253ad74af1411620eac4ad345b7ad685
commit: 9c38e39

4622 files changed, 168447 insertions(+), 169156 deletions(-)

Improvements:
  correlated-value-propagation.NumNUW 416669 -> 513134 +23.15%
  correlated-value-propagation.NumNSW 476939 -> 548783 +15.06%
  correlated-value-propagation.NumAnd 30000 -> 30021 +0.07%
  correlated-value-propagation.NumAShrsConverted 4458 -> 4460 +0.04%
  loop-simplifycfg.NumLoopExitsDeleted 2680 -> 2681 +0.04%
  loop-simplifycfg.NumTerminatorsFolded 8087 -> 8090 +0.04%
  correlated-value-propagation.NumPhiCommon 49776 -> 49792 +0.03%
  instcombine.NegatorNumNegationsFoundInCache 4244 -> 4245 +0.02%
  correlated-value-propagation.NumMinMax 13360 -> 13363 +0.02%
  licm.NumMovedCalls 25420 -> 25424 +0.02%
Regressions:
  instcombine.NumExpand 1859 -> 1843 -0.86%
  function-attrs.NumNoUndefReturn 61264 -> 61216 -0.08%
  memdep.NumUncacheNonLocal 25271 -> 25257 -0.06%
  instcombine.NumCombined 105576269 -> 105537435 -0.04%
  simplifycfg.NumHoistCommonInstrs 1795410 -> 1795036 -0.02%
  bdce.NumSimplified 5348 -> 5347 -0.02%
  scalar-evolution.NumBruteForceTripCountsComputed 79839 -> 79826 -0.02%
  memdep.NumCacheNonLocal 19643 -> 19641 -0.01%
  instcombine.NumTwoIterations 16932212 -> 16930658 -0.01%
  reassociate.NumChanged 4258339 -> 4258001 -0.01%

1 1 bench/abc/optimized/FxchMan.ll
25 26 bench/arrow/optimized/compare.ll
27 28 bench/arrow/optimized/int_util.ll
5 4 bench/arrow/optimized/interfaces.ll
12 16 bench/arrow/optimized/vector_selection_filter_internal.ll
58 51 bench/assimp/optimized/FBXConverter.ll
11 11 bench/bdwgc/optimized/gc.ll
8 5 bench/boost/optimized/ext.ll
13 13 bench/brotli/optimized/backward_references_hq.ll
2 2 bench/brotli/optimized/bit_cost.ll
9 9 bench/brotli/optimized/encode.ll
3 3 bench/c3c/optimized/lexer.ll
8 9 bench/clamav/optimized/bytecode_api.ll
6 7 bench/clamav/optimized/pe.ll
42 41 bench/cpp-httplib/optimized/httplib.ll
2 1 bench/cvc5/optimized/cardinality_extension.ll
20 24 bench/cxxopts/optimized/example.ll
2 3 bench/faiss/optimized/ProductQuantizer.ll
10 10 bench/flatbuffers/optimized/idl_parser.ll
5 14 bench/git/optimized/stash.ll
11 10 bench/gromacs/optimized/readpull.ll
14 8 bench/hermes/optimized/Process.ll
73 32 bench/hermes/optimized/Triple.ll
6 6 bench/html5ever-rs/optimized/4e9vfrmeneic1jap.ll
8 8 bench/jsonnet/optimized/vm.ll
4 6 bench/libquic/optimized/pickle.ll
52 50 bench/llama.cpp/optimized/chat.ll
49 48 bench/llama.cpp/optimized/json-schema-to-grammar.ll
13 15 bench/llvm/optimized/AArch64ISelLowering.ll
10 19 bench/llvm/optimized/Distro.ll
6 10 bench/llvm/optimized/Instructions.ll
3 4 bench/llvm/optimized/RISCVAsmParser.ll
24 28 bench/llvm/optimized/X86ISelLowering.ll
6 10 bench/lua/optimized/ltable.ll
29 29 bench/lz4/optimized/lz4hc.ll
14 16 bench/meilisearch-rs/optimized/4rtt9oltj0ubuf08.ll
9 11 bench/meilisearch-rs/optimized/4tsjgmg5dc8wpnes.ll
53 53 bench/miniaudio/optimized/unity.ll
13 15 bench/mold/optimized/icf.cc.X86_64.ll
12 12 bench/nanobind/optimized/test_stl.ll
26 30 bench/nix/optimized/hilite.ll
24 23 bench/nix/optimized/search.ll
16 15 bench/nori/optimized/button.ll
27 26 bench/nori/optimized/checkbox.ll
18 19 bench/ockam-rs/optimized/274k60s1efyiyv8u.ll
44 44 bench/oiio/optimized/CineonHeader.ll
14 19 bench/opencv/optimized/stringprintf.ll
14 10 bench/openvdb/optimized/MultiResGrid.ll
28 28 bench/ozz-animation/optimized/gltf2ozz.ll
5 5 bench/ozz-animation/optimized/jsoncpp.ll
3 2 bench/postgres/optimized/pg_operator.ll
14 14 bench/pugixml/optimized/pugixml.ll
24 24 bench/raylib/optimized/raudio.ll
14 15 bench/redis/optimized/rax.ll
11 15 bench/regex-rs/optimized/33whcn8n29l9c6ys.ll
26 38 bench/regex-rs/optimized/3bb5ih3626n2er1d.ll
4 5 bench/ruby/optimized/ractor.ll
7 8 bench/ruby/optimized/raddrinfo.ll
3 2 bench/rust-analyzer-rs/optimized/2deyu58ajds9ccnn.ll
13 14 bench/rust-analyzer-rs/optimized/ii5fl5y94ca5wd9.ll
38 38 bench/spdlog/optimized/bundled_fmtlib_format.ll
65 65 bench/sqlite/optimized/sqlite3.ll
34 34 bench/tev/optimized/ExrImageSaver.ll
15 15 bench/tev/optimized/HelpWindow.ll
31 31 bench/tinygltf/optimized/tiny_gltf.ll
13 15 bench/tokenizers-rs/optimized/1k9vblvd5jyd3qmf.ll
41 41 bench/tomlplusplus/optimized/toml.ll
5 9 bench/turborepo-rs/optimized/3wg34qzs64td8o5fq33fcg5rk.ll
41 52 bench/typst-rs/optimized/2d3c2n5y91mtl0x0.ll
10 23 bench/typst-rs/optimized/4m3ebbqd1xx21e5m.ll
4 4 bench/unicode-normalization-rs/optimized/kwscsepwptyv51i.ll
5 10 bench/velox/optimized/SsdFile.ll
32 32 bench/wasmedge/optimized/alias.ll
30 30 bench/wasmedge/optimized/jit.ll
15 14 bench/xgboost/optimized/context.ll
13 33 bench/yalantinglibs/optimized/client.ll
19 39 bench/yalantinglibs/optimized/client_pool.ll
20 40 bench/yalantinglibs/optimized/client_pools.ll
14 34 bench/yalantinglibs/optimized/concurrent_clients.ll
16 36 bench/yalantinglibs/optimized/data_gen.ll
15 35 bench/yalantinglibs/optimized/file_server.ll
7 7 bench/yyjson/optimized/yyjson.ll
85 74 bench/zed-rs/optimized/20fr88unk1byt75zzz5ooa6xr.ll
34 32 bench/zed-rs/optimized/6a257z75npqxppetnyj7rxh76.ll
40 37 bench/zed-rs/optimized/8uq0kpgi8jqekwanrrlvbr0h1.ll
30 38 bench/zed-rs/optimized/8x58xp4s22l8izlb56sviitm3.ll
10 8 bench/zed-rs/optimized/a9o648rm8h3erlto15zyd64wi.ll

Copy link
Contributor

github-actions bot commented Mar 9, 2025

The provided LLVM IR diffs across multiple files reveal several recurring patterns of changes, which can be summarized into the following five major categories:

  1. Truncation Instruction Updates:

    • Numerous truncation instructions have been updated to include additional flags (nuw and nsw). For instance, in many places where there was %X = trunc i64 %Y to i32, it has been changed to %X = trunc nuw nsw i64 %Y to i32. This applies similarly for other truncations like from i64 to i8, i32 to i8, etc.
    • Example:
      %59 = trunc nuw nsw i64 %58 to i32
  2. Integer Comparison Adjustments:

    • There are modifications in integer comparisons, especially changing from checking if a value is equal to zero after masking or shifting operations to directly comparing against specific values or conditions.
    • Example:
      %.not14.i.i.i = icmp ne i32 %bcmp.i, 0
  3. Phi Node Modifications:

    • Phi nodes have been adjusted to handle different types or conditions more explicitly. In some cases, phi nodes were modified to use narrower integer types or incorporate additional conditions.
    • Example:
      %.sroa.0.0 = phi i8 [ 2, %.loopexit ], [ 1, %24 ], [ 0, %27 ], [ 2, %.lr.ph.i ]
  4. Branch Condition Changes:

    • Branch conditions have been refined to either simplify or make the logic more explicit by using select instructions or combining conditions with logical operators (and, or).
    • Example:
      %or.cond.i = select i1 %.not14.i.i.i, i1 true, i1 %64
      br i1 %or.cond.i, ...
  5. Function Declarations and Calls:

    • Function declarations and calls involving umin and umax have been adjusted to match operand sizes more consistently, such as changing from i32 to i64 or vice versa.
    • Example:
      declare i64 @llvm.umin.i64(i64, i64) #19
      Replacing:
      declare i32 @llvm.umin.i32(i32, i32) #19

High-Level Overview:

These changes generally aim at improving the precision and safety of operations within the LLVM IR by ensuring that truncations and comparisons adhere strictly to signedness and width constraints. The inclusion of nuw (No Unsigned Wrap) and nsw (No Signed Wrap) flags on truncation instructions helps prevent potential overflow issues during type conversions. Additionally, refining branch conditions and phi nodes enhances clarity and correctness in control flow and data handling.

Overall, these modifications likely result from optimization passes aimed at generating safer and potentially more efficient machine code by enforcing stricter arithmetic properties and simplifying complex conditional logic.

model: qwen-plus-latest
CompletionUsage(completion_tokens=678, prompt_tokens=109482, total_tokens=110160, completion_tokens_details=None, prompt_tokens_details=None)

@@ -14782,6 +14782,7 @@ _ZNSt6vectorIN4cvc58internal12NodeTemplateILb1EEESaIS3_EE8pop_backEv.exit: ; pre
.preheader.lr.ph: ; preds = %._crit_edge
%56 = getelementptr inbounds nuw i8, ptr %12, i64 8
%57 = getelementptr inbounds nuw i8, ptr %12, i64 16
%wide.trip.count97 = and i64 %.lcssa85, 4294967295
Copy link
Owner Author

Choose a reason for hiding this comment

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

Regression

%ref.tmp.sroa.102.1 = phi i1 [ false, %_ZN4llvh12StringSwitchINS_6Triple6OSTypeES2_E10StartsWithENS_13StringLiteralES2_.exit1062 ], [ false, %if.end.i.i1026 ], [ %ref.tmp.sroa.102.0.ph, %_ZN4llvh12StringSwitchINS_6Triple6OSTypeES2_E10StartsWithENS_13StringLiteralES2_.exit1062.thread ]
%or.cond132 = or i1 %cmp.i.i1049.not, %ref.tmp.sroa.102.1
%ref.tmp.sroa.102.1 = phi i8 [ 0, %_ZN4llvh12StringSwitchINS_6Triple6OSTypeES2_E10StartsWithENS_13StringLiteralES2_.exit1062 ], [ 0, %if.end.i.i1026 ], [ %ref.tmp.sroa.102.0.ph, %_ZN4llvh12StringSwitchINS_6Triple6OSTypeES2_E10StartsWithENS_13StringLiteralES2_.exit1062.thread ]
%tobool.i170 = trunc nuw i8 %ref.tmp.sroa.102.1 to i1
Copy link
Owner Author

Choose a reason for hiding this comment

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

Regression

%ref.tmp.sroa.28.4.i = phi i1 [ false, %if.end.i.i202.i ], [ %ref.tmp.sroa.28.3.ph.i, %_ZN4llvh12StringSwitchIbbE10StartsWithENS_13StringLiteralEb.exit100.thread149.i ]
%or.cond36.i = select i1 %ref.tmp.sroa.28.4.i, i1 true, i1 %cmp.i198.not120.i
%ref.tmp.sroa.28.4.i = phi i8 [ 0, %if.end.i.i202.i ], [ %ref.tmp.sroa.28.3.ph.i, %_ZN4llvh12StringSwitchIbbE10StartsWithENS_13StringLiteralEb.exit100.thread149.i ]
%tobool.i62.i = trunc nuw i8 %ref.tmp.sroa.28.4.i to i1
Copy link
Owner Author

Choose a reason for hiding this comment

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

Regression

%tobool23.not = icmp eq i32 %and, 0
%and25 = and i32 %ijk.sroa.3.0.extract.trunc, 1
%tobool26.not = icmp eq i32 %and25, 0
%or.cond = select i1 %tobool23.not, i1 %tobool26.not, i1 false
Copy link
Owner Author

Choose a reason for hiding this comment

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

Regression

br i1 %19, label %.lr.ph, label %.loopexit, !llvm.loop !4
%19 = trunc nuw i64 %indvars.iv to i32
%20 = icmp sgt i32 %19, 0
br i1 %20, label %.lr.ph, label %.loopexit, !llvm.loop !4
Copy link
Owner Author

Choose a reason for hiding this comment

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

Regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants