Skip to content

pre-commit: PR128861 #2230

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: PR128861 #2230

wants to merge 3 commits into from

Conversation

dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Mar 31, 2025

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

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

dtcxzyw commented Mar 31, 2025

Diff mode

runner: ariselab-64c-v2
baseline: llvm/llvm-project@5c65a32
patch: llvm/llvm-project#128861
sha256: f80be7346fab7768151790d7c422065f9b7581027729dc8c76f12fb646877381
commit: 49bc44c

673 files changed, 521003 insertions(+), 522372 deletions(-)

Improvements:
  aggressive-instcombine.NumAnyOrAllBitsSet 71 -> 72 +1.41%
  correlated-value-propagation.NumAnd 29995 -> 30206 +0.70%
  correlated-value-propagation.NumAddNUW 206144 -> 206320 +0.09%
  correlated-value-propagation.NumAddNW 442588 -> 442764 +0.04%
  correlated-value-propagation.NumNUW 513042 -> 513223 +0.04%
  licm.NumGEPsHoisted 44003 -> 44013 +0.02%
  correlated-value-propagation.NumNW 893330 -> 893508 +0.02%
  reassociate.NumChanged 4254626 -> 4255194 +0.01%
  adce.NumRemoved 93457 -> 93466 +0.01%
  correlated-value-propagation.NumCmps 259521 -> 259541 +0.01%
Regressions:
  instcombine.NumConstProp 129921 -> 129442 -0.37%
  instsimplify.NumReassoc 344913 -> 343973 -0.27%
  correlated-value-propagation.NumSelects 212100 -> 211708 -0.18%
  aggressive-instcombine.NumExprsReduced 19275 -> 19254 -0.11%
  simplifycfg.NumSpeculations 366469 -> 366076 -0.11%
  aggressive-instcombine.NumInstrsReduced 59769 -> 59714 -0.09%
  simple-loop-unswitch.NumCostMultiplierSkipped 13390 -> 13382 -0.06%
  bdce.NumSimplified 5344 -> 5341 -0.06%
  instcombine.NumExpand 1843 -> 1842 -0.05%
  jump-threading.NumFolds 2221871 -> 2220776 -0.05%

8 6 bench/boost/optimized/get_turns_linear_linear_geo.ll
5 8 bench/box2d/optimized/imgui.ll
3 5 bench/c3c/optimized/sema_expr.ll
3 4 bench/clamav/optimized/others.ll
3 6 bench/darktable/optimized/decoders_dcraw.ll
4 7 bench/darktable/optimized/identify_tools.ll
16 16 bench/delta-rs/optimized/11w0at10aiwuq3yr.ll
15 10 bench/delta-rs/optimized/3qvofkyb7k5flefa.ll
6 9 bench/graphviz/optimized/compile.ll
2 1 bench/gromacs/optimized/lincs.ll
3 6 bench/grpc/optimized/client_authority_filter.ll
17 21 bench/grpc/optimized/compression_filter.ll
5 7 bench/grpc/optimized/fault_injection_service_config_parser.ll
32 40 bench/grpc/optimized/http_server_filter.ll
2 4 bench/grpc/optimized/retry_service_config.ll
17 20 bench/grpc/optimized/tls_security_connector.ll
126 146 bench/harfbuzz/optimized/hb-subset-plan.ll
7 6 bench/hdf5/optimized/H5EA.ll
18 19 bench/hdf5/optimized/H5FDcore.ll
9 7 bench/hdf5/optimized/H5Tconv_vlen.ll
5 4 bench/icu/optimized/numparse_affixes.ll
29 33 bench/image-rs/optimized/1clnprdgqfw2q9lq.ll
9 10 bench/image-rs/optimized/30755d6iao7ojcvl.ll
5 4 bench/just-rs/optimized/2sblcsgax6v4zfcc.ll
12 18 bench/lief/optimized/QNXStack.ll
39 38 bench/llama.cpp/optimized/llama-vocab.ll
3 4 bench/llvm/optimized/CodeGenDAGPatterns.ll
16 27 bench/llvm/optimized/LiteralSupport.ll
12 15 bench/llvm/optimized/MemoryOpRemark.ll
13 19 bench/llvm/optimized/PPMacroExpansion.ll
2 4 bench/llvm/optimized/Process.ll
3 2 bench/llvm/optimized/RemarkLinker.ll
3 5 bench/llvm/optimized/ScalarEvolutionExpander.ll
5 3 bench/llvm/optimized/SemaDeclCXX.ll
27 31 bench/llvm/optimized/StackSafetyAnalysis.ll
19 15 bench/luau/optimized/Simplify.ll
38 40 bench/luau/optimized/Type.ll
77 79 bench/luau/optimized/TypeFunctionRuntime.ll
31 27 bench/mitsuba3/optimized/hdrfilm.ll
39 23 bench/mitsuba3/optimized/imageblock.ll
6 12 bench/node/optimized/libnode.crypto_dh.ll
3 4 bench/opencv/optimized/dxt.ll
10 9 bench/openjdk/optimized/cdsConfig.ll
4 3 bench/openjdk/optimized/parallelScavengeHeap.ll
81 79 bench/openjdk/optimized/serviceThread.ll
15 26 bench/openspiel/optimized/dark_chess.ll
4 2 bench/openspiel/optimized/goofspiel.ll
43 34 bench/openspiel/optimized/observation_history.ll
6 4 bench/openspiel/optimized/observer.ll
14 12 bench/openspiel/optimized/twixtboard.ll
18 19 bench/openssl/optimized/ts_rsp_verify.ll
22 23 bench/pbrt-v4/optimized/integrators.ll
18 18 bench/php/optimized/session.ll
5 4 bench/postgres/optimized/aclchk.ll
3 2 bench/postgres/optimized/foreigncmds.ll
14 13 bench/postgres/optimized/gistutil.ll
2 3 bench/postgres/optimized/pl_exec.ll
5 5 bench/proxygen/optimized/QPACKEncoder.ll
2 2 bench/ripgrep-rs/optimized/1tu4ff7k1l20r9ex.ll
2 2 bench/ripgrep-rs/optimized/w48b1qsmd8jodkv.ll
2 3 bench/rocksdb/optimized/pessimistic_transaction.ll
6 4 bench/rust-analyzer-rs/optimized/2mbx5ptcpq6fo7sc.ll
3 5 bench/rust-analyzer-rs/optimized/357j944nkpwuonjr.ll
5 9 bench/rust-analyzer-rs/optimized/3o2zsvb0ik8z2nqt.ll
3 5 bench/rust-analyzer-rs/optimized/k5mtltw7nxmadpl.ll
55 56 bench/spike/optimized/sim.ll
16 17 bench/turborepo-rs/optimized/eyin3u3cupdp2wcinr2t4x92g.ll
12 8 bench/typst-rs/optimized/59tuvc5m3xlovl3o.ll
6 6 bench/vcpkg/optimized/sourceparagraph.ll
4 8 bench/velox/optimized/StringFunctions.ll
1 1 bench/verilator/optimized/V3Const__gen.ll
8 6 bench/wasmtime-rs/optimized/3vdx8w41hjyzioqv.ll
41 57 bench/wasmtime-rs/optimized/50oljwux3amwt8rq.ll
3 2 bench/wireshark/optimized/packet-dmp.ll
3 4 bench/wireshark/optimized/wlan_statistics_dialog.ll
4 6 bench/z3/optimized/api_ast.ll
4 6 bench/z3/optimized/api_solver.ll
10 12 bench/z3/optimized/ast_ll_pp.ll
3 7 bench/z3/optimized/dioph_eq.ll
21 23 bench/z3/optimized/smt_theory.ll
3 5 bench/z3/optimized/special_relations_decl_plugin.ll
26 30 bench/zed-rs/optimized/5x7hg1mlcao6i0r3jb3d14b77.ll
8 6 bench/zed-rs/optimized/695kya77ce1y5fjxr4ewl21f4.ll
18 20 bench/zed-rs/optimized/738kk4f8xx4axqteya4t2w4qw.ll
37 41 bench/zed-rs/optimized/d5przcl3nwvj7ddp1j7ydu4aq.ll

Copy link
Contributor

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

  1. Simplification and restructuring of boolean logic:

    • Many instances of truncating i8 or i16 values to i1 have been replaced with direct icmp comparisons.
    • Complex combinations of and/or/xor operations on truncated values have been simplified to single icmp comparisons.
    • Some select instructions with boolean results have been replaced with simpler icmp instructions.
  2. Changes in phi node types:

    • Several phi nodes that previously produced i1 values now produce i8 or i16 values.
    • This change affects subsequent instructions that use these phi node results, often requiring additional icmp instructions.
  3. Reordering of instructions:

    • In some cases, the order of loading values and performing comparisons has been changed.
    • This reordering can lead to more straightforward control flow structures.
  4. Replacement of trunc + icmp patterns:

    • Patterns where an i8 or i16 value was truncated to i1 before comparison have been replaced with direct icmp instructions on the original type.
    • This reduces the number of intermediate instructions.
  5. Phi node elimination:

    • In some cases, phi nodes have been eliminated by restructuring the control flow.
    • This simplifies the code and reduces the number of instructions needed to handle conditional values.

These changes generally aim to simplify the control flow and reduce the number of intermediate instructions, potentially improving performance and reducing code size. The transformations appear to be consistent across multiple benchmarks, indicating they may be part of a broader optimization pass or pattern replacement in the compiler.

model: qwen-plus-latest
CompletionUsage(completion_tokens=320, prompt_tokens=113225, total_tokens=113545, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant