Skip to content

Conversation

@dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Feb 26, 2025

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

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

dtcxzyw commented Feb 26, 2025

Diff mode

runner: ariselab-64c-v2
baseline: llvm/llvm-project@2d12c9e
patch: llvm/llvm-project#128861
sha256: f80be7346fab7768151790d7c422065f9b7581027729dc8c76f12fb646877381
commit: cba3479

655 files changed, 462157 insertions(+), 463525 deletions(-)

Improvements:
  aggressive-instcombine.NumAnyOrAllBitsSet 71 -> 72 +1.41%
  correlated-value-propagation.NumAnd 30267 -> 30476 +0.69%
  correlated-value-propagation.NumAddNUW 204023 -> 204199 +0.09%
  correlated-value-propagation.NumNUW 410494 -> 410671 +0.04%
  correlated-value-propagation.NumAddNW 439078 -> 439254 +0.04%
  licm.NumGEPsHoisted 42076 -> 42086 +0.02%
  correlated-value-propagation.NumNW 883600 -> 883778 +0.02%
  reassociate.NumChanged 4190478 -> 4191019 +0.01%
  instcombine.NumFactor 40528 -> 40533 +0.01%
  adce.NumRemoved 90521 -> 90530 +0.01%
Regressions:
  instcombine.NumConstProp 126502 -> 126023 -0.38%
  instsimplify.NumReassoc 339980 -> 339056 -0.27%
  correlated-value-propagation.NumSelects 211342 -> 210950 -0.19%
  simplifycfg.NumSpeculations 359779 -> 359386 -0.11%
  aggressive-instcombine.NumExprsReduced 19376 -> 19357 -0.10%
  aggressive-instcombine.NumInstrsReduced 59919 -> 59866 -0.09%
  simple-loop-unswitch.NumCostMultiplierSkipped 13507 -> 13499 -0.06%
  instcombine.NumExpand 1830 -> 1829 -0.05%
  bdce.NumSimplified 5571 -> 5568 -0.05%
  jump-threading.NumFolds 2201710 -> 2200625 -0.05%

8 6 bench/boost/optimized/get_turns_linear_linear_geo.ll
8 6 bench/boost/optimized/sym_difference_linear_linear.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
2 2 bench/delta-rs/optimized/2n0ez5zuwgs53clg.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
5 7 bench/grpc/optimized/tcp_connect_handshaker.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
30 34 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
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
41 37 bench/proj/optimized/datum.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
4 4 bench/typst-rs/optimized/4qskctz4kwc33g7b.ll
4 8 bench/velox/optimized/StringFunctions.ll
44 46 bench/verilator/optimized/V3EmitCBase.ll
2 2 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
3 2 bench/yosys/optimized/dfflibmap.ll
2 4 bench/z3/optimized/ast_ll_pp.ll
5 7 bench/z3/optimized/maximize_ac_sharing.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
1 3 bench/zed-rs/optimized/a9o648rm8h3erlto15zyd64wi.ll

@github-actions
Copy link
Contributor

Here is a summary of the major changes in this LLVM IR patch:

  1. Condition Simplification and Transformation:

    • Many conditions involving truncation of integer types to i1 have been replaced with direct comparisons (icmp eq or icmp ne) on wider integer types. For example, instead of truncating an i8 to i1 and then performing a comparison, the comparison is now done directly on the i8 value.
    • Logical operations (and, or, xor) are often replaced with equivalent comparisons or restructured for clarity.
  2. Phi Node Adjustments:

    • Several phi nodes have been adjusted to use different types (e.g., changing from i1 to i8 or vice versa) based on the new condition transformations. This ensures that the phi nodes correctly handle the updated control flow and data types.
  3. Control Flow Restructuring:

    • Branching logic has been restructured in multiple places. For instance, some branches now directly compare values instead of relying on intermediate truncations or logical operations.
    • Some basic blocks have been merged or split to simplify the control flow and reduce redundancy.
  4. Memory Access Optimization:

    • In several files, memory accesses (e.g., load and store instructions) have been reordered or simplified. For example, unnecessary intermediate variables are removed, and operations are directly applied to loaded values.
    • Lifetime markers (llvm.lifetime.start and llvm.lifetime.end) are sometimes moved or adjusted to better reflect the new control flow.
  5. Constant Folding and Masking:

    • Constants used in bitwise operations (e.g., and masks) have been adjusted to include additional bits (e.g., changing from 256 to 257 or -4294967040 to -4294967039). This reflects changes in how certain conditions are evaluated.
    • Some constants are combined into single operations, reducing the number of instructions needed for specific computations.

These changes collectively aim to improve the efficiency and readability of the generated code by simplifying conditions, optimizing memory access patterns, and restructuring control flow. The transformations likely result from improvements in LLVM's optimization passes, such as instruction combining, constant propagation, or dead code elimination.

model: qwen-plus-latest
CompletionUsage(completion_tokens=489, prompt_tokens=112966, total_tokens=113455, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Mar 31, 2025
@dtcxzyw dtcxzyw deleted the test-run13542727542 branch June 6, 2025 15:47
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