Skip to content

Conversation

@dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Apr 12, 2025

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

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

dtcxzyw commented Apr 12, 2025

Diff mode

runner: ariselab-64c-v2
baseline: llvm/llvm-project@b71123f
patch: llvm/llvm-project#135490
sha256: 477b71d27dd40dfd95f3fd9f6da7b685aa1d65339af6cfc6c97e4b47c2d178b2
commit: 1d80218

8865 files changed, 13745179 insertions(+), 13801712 deletions(-)

Improvements:
  correlated-value-propagation.NumAnd 30206 -> 38211 +26.50%
  aggressive-instcombine.NumAnyOrAllBitsSet 72 -> 87 +20.83%
  simplifycfg.NumFoldBranchToCommonDest 595671 -> 674965 +13.31%
  instcombine.NumExpand 1842 -> 1977 +7.33%
  simple-loop-unswitch.NumCostMultiplierSkipped 13382 -> 13500 +0.88%
  licm.NumGEPsHoisted 44013 -> 44335 +0.73%
  correlated-value-propagation.NumPhiCommon 49848 -> 50131 +0.57%
  aggressive-instcombine.NumExprsReduced 19254 -> 19334 +0.42%
  jump-threading.NumDupes 113110 -> 113564 +0.40%
  gvn.NumPRELoopLoad 2030 -> 2038 +0.39%
Regressions:
  correlated-value-propagation.NumReturns 235 -> 217 -7.66%
  instcombine.NumConstProp 129442 -> 122376 -5.46%
  adce.NumBranchesRemoved 21168 -> 20822 -1.63%
  callsite-splitting.NumCallSiteSplit 7586 -> 7557 -0.38%
  correlated-value-propagation.NumPhis 1114884 -> 1110670 -0.38%
  instcombine.NegatorNumNegationsFoundInCache 4259 -> 4247 -0.28%
  bdce.NumSimplified 5339 -> 5324 -0.28%
  memdep.NumCacheNonLocalPtr 223910359 -> 223350088 -0.25%
  simplifycfg.NumHoistCommonCode 605575 -> 604105 -0.24%
  local.NumPHICSEs 157446 -> 157076 -0.24%

7 9 bench/abc/optimized/cswCut.ll
10 9 bench/abseil-cpp/optimized/log_streamer_test.ll
14 18 bench/actix-rs/optimized/3k33h0ss7dy62evb.ll
7 8 bench/arrow/optimized/init.ll
10 12 bench/boost/optimized/ipc_reliable_message_queue.ll
23 19 bench/boost/optimized/round_robin.ll
23 19 bench/boost/optimized/shared_work.ll
17 19 bench/boost/optimized/xml_woarchive.ll
12 15 bench/box2d/optimized/sample_benchmark.ll
19 17 bench/bullet3/optimized/btGeneric6DofSpring2Constraint.ll
11 14 bench/bullet3/optimized/btTypedConstraint.ll
5 7 bench/c3c/optimized/llvm_codegen_stmt.ll
34 44 bench/chibicc/optimized/codegen.ll
8 10 bench/chibicc/optimized/type.ll
7 10 bench/clamav/optimized/getbits.ll
35 45 bench/clap-rs/optimized/1rbie63mhpvpjak.ll
5 7 bench/cmake/optimized/archive_write_set_format.ll
22 21 bench/cpython/optimized/_csv.ll
28 34 bench/cpython/optimized/_json.ll
10 17 bench/cpython/optimized/symtable.ll
20 26 bench/csmith/optimized/FunctionInvocationBinary.ll
8 10 bench/csmith/optimized/Statement.ll
6 8 bench/curl/optimized/cf-https-connect.ll
31 32 bench/curl/optimized/vtls.ll
7 3 bench/darktable/optimized/RawDecoder.ll
5 6 bench/draco/optimized/mesh_edgebreaker_encoder.ll
16 20 bench/duckdb/optimized/cipher.ll
5 6 bench/eastl/optimized/EADateTime.ll
9 14 bench/eastl/optimized/EATest.ll
18 14 bench/eastl/optimized/eathread_condition.ll
30 33 bench/folly/optimized/DelayedDestruction.ll
12 14 bench/folly/optimized/HHWheelTimer.ll
21 24 bench/folly/optimized/STTimerFDTimeoutManager.ll
10 12 bench/g2o/optimized/filesys_tools.ll
79 80 bench/glog/optimized/raw_logging.ll
23 22 bench/graphviz/optimized/flat.ll
7 5 bench/graphviz/optimized/position.ll
6 8 bench/gromacs/optimized/datastorage.ll
12 11 bench/gromacs/optimized/directoryenumerator.ll
16 20 bench/gromacs/optimized/filestream.ll
9 7 bench/grpc/optimized/alts_handshaker_client.ll
6 10 bench/grpc/optimized/iam_credentials.ll
9 10 bench/grpc/optimized/polling_resolver.ll
12 13 bench/hdf5/optimized/H5Dnone.ll
4 6 bench/hermes/optimized/JSONEmitter.ll
11 13 bench/ipopt/optimized/IpMa27TSolverInterface.ll
11 13 bench/ipopt/optimized/IpMa57TSolverInterface.ll
25 27 bench/jemalloc/optimized/large.ll
14 15 bench/jemalloc/optimized/tsd.ll
42 54 bench/just-rs/optimized/2sotx4bdu006z307.ll
59 61 bench/libphonenumber/optimized/asyoutypeformatter.ll
13 17 bench/libquic/optimized/activity_tracker.ll
7 8 bench/libquic/optimized/quic_crypto_client_config.ll
12 16 bench/libuv/optimized/core.ll
21 31 bench/libwebp/optimized/image_enc.ll
12 20 bench/libwebp/optimized/io_dec.ll
6 9 bench/libzmq/optimized/reaper.ll
11 18 bench/lief/optimized/cipher.ll
43 50 bench/lightgbm/optimized/train_share_states.ll
7 9 bench/lightgbm/optimized/voting_parallel_tree_learner.ll
11 15 bench/llama.cpp/optimized/llama-quant.ll
5 4 bench/llvm/optimized/AArch64GlobalISelUtils.ll
21 20 bench/luau/optimized/Anyification.ll
19 21 bench/luau/optimized/Symbol.ll
6 7 bench/lvgl/optimized/lv_init.ll
12 9 bench/memcached/optimized/testapp.ll
25 30 bench/meshlab/optimized/AlignPairWidget.ll
39 41 bench/meshlab/optimized/dirt_utils.ll
7 5 bench/meshlab/optimized/filter_dock_dialog.ll
7 8 bench/mimalloc/optimized/init.ll
19 23 bench/mini-lsm-rs/optimized/29sn4tiur79wqexc.ll
11 13 bench/mini-lsm-rs/optimized/pew1bqmcl3zb6gg.ll
28 36 bench/miniaudio/optimized/unity.ll
14 19 bench/mitsuba3/optimized/spiral.ll
7 8 bench/mold/optimized/init.ll
17 20 bench/mold/optimized/input-sections.cc.X86_64.ll
51 50 bench/ms-gsl/optimized/span_tests.ll
6 9 bench/nanobind/optimized/test_classes.ll
10 12 bench/ncnn/optimized/binaryop_x86.ll
8 13 bench/nix/optimized/config.ll
8 7 bench/node/optimized/libnode.node.ll
16 17 bench/nori/optimized/widget.ll
6 8 bench/ocio/optimized/FileFormat3DL.ll
22 23 bench/ocio/optimized/Processor.ll
6 8 bench/ockam-rs/optimized/2rihuzhmont6zqqo.ll
6 8 bench/oiio/optimized/oiio_gpu.ll
23 25 bench/openspiel/optimized/bargaining.ll
12 9 bench/openusd/optimized/debugger.ll
14 16 bench/openusd/optimized/glslfx.ll
12 15 bench/php/optimized/head.ll
6 3 bench/php/optimized/phpdbg_prompt.ll
9 5 bench/protobuf/optimized/string_field.ll
6 9 bench/proxygen/optimized/FileServerListGenerator.ll
5 6 bench/proxygen/optimized/HTTPDefaultSessionCodecFactory.ll
6 8 bench/qemu/optimized/howvec.ll
6 8 bench/qemu/optimized/user.ll
37 49 bench/quickjs/optimized/quickjs.ll
25 36 bench/rayon-rs/optimized/5ev50in5ju1pej99.ll
18 23 bench/re2/optimized/re2.ll
8 9 bench/redis/optimized/ctl.ll
5 7 bench/regex-rs/optimized/6f4i3c8223u3bmw.ll
8 10 bench/regex-rs/optimized/v8mcpnwv4glojx2.ll
7 6 bench/rocksdb/optimized/binary_search_index_reader.ll
8 7 bench/rocksdb/optimized/full_filter_block.ll
28 36 bench/rust-analyzer-rs/optimized/1a2athgpe0u8z37j.ll
11 15 bench/smol-rs/optimized/42mrm3r913zsut0b.ll
18 16 bench/spike/optimized/remote_bitbang.ll
8 6 bench/spike/optimized/xspike.ll
37 53 bench/tls-rs/optimized/4vvnrvl2eceao62c.ll
6 7 bench/tls-rs/optimized/526n7g8rwc65lc9b.ll
9 11 bench/tree-sitter-rs/optimized/2ysit6xak1d4lr67.ll
21 23 bench/verilator/optimized/V3Premit.ll
14 18 bench/wasmedge/optimized/executor.ll
14 18 bench/wasmedge/optimized/vm.ll
2 4 bench/wireshark/optimized/packet-gsm_gsup.ll
8 10 bench/yalantinglibs/optimized/FieldGenerator.ll
7 10 bench/yalantinglibs/optimized/conformance_test.ll
7 9 bench/yosys/optimized/drivertools.ll
18 25 bench/z3/optimized/proof_cmds.ll
15 21 bench/zed-rs/optimized/2bjv2ryetyqaw0uwjf53eylb3.ll
20 26 bench/zxing/optimized/PDFBoundingBox.ll

@github-actions
Copy link
Contributor

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

  1. Condition Simplification and Reordering: Many branches have been simplified by combining multiple conditions into a single select instruction. This reduces the number of basic blocks and improves control flow readability. For example, in several files (clamav/optimized/getbits.ll, just-rs/optimized/2sotx4bdu006z307.ll), conditions are combined using select before branching.

  2. Switch Statement Optimization: Switch statements have been optimized by removing intermediate blocks like switch.hole_check and directly computing the condition for branching to the appropriate case. This is evident in files such as c3c/optimized/llvm_codegen_stmt.ll and chibicc/optimized/type.ll, where the switch.maskindex, switch.shifted, and switch.lobit computations are now part of the main block rather than separate predecessors.

  3. Phi Node Adjustments: Phi nodes have been adjusted to include fewer predecessors or reorder them for clarity and efficiency. In cpython/optimized/_csv.ll, glog/optimized/raw_logging.ll, and others, phi nodes now correctly reflect the new control flow structure after optimizations.

  4. Load and Store Instructions: Several load and store instructions have been modified to use different alignments or TBAA (Type-Based Alias Analysis) metadata. For instance, in actix-rs/optimized/3k33h0ss7dy62evb.ll and eastl/optimized/eathread_condition.ll, loads and stores have updated alignment and TBAA information, potentially improving memory access patterns.

  5. Branch Predicate Changes: Branch predicates have been altered from simple comparisons to more complex logical operations involving select and or. An example is in grpc/optimized/alts_handshaker_client.ll where %or.cond combines multiple conditions before deciding the branch target.

These changes collectively aim to improve performance by streamlining control flow, reducing the number of basic blocks, optimizing memory accesses, and enhancing the clarity of conditional logic. They also ensure better adherence to TBAA rules and adjust loop structures for potential vectorization or other backend optimizations.

model: qwen-plus-latest
CompletionUsage(completion_tokens=462, prompt_tokens=102330, total_tokens=102792, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Apr 13, 2025
@dtcxzyw dtcxzyw deleted the test-run14422555995 branch May 18, 2025 09:31
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