Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Oct 30, 2025

Link: llvm/llvm-project#165700
Requested by: @Camsyn

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

zyw-bot commented Oct 30, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@57ff891
patch: llvm/llvm-project#165700
sha256: 207622968889abad0ee8c5053b3a50d95ca2711d7247b402650e89b12bca7fc7
commit: 78e7bcd

960 files changed, 701384 insertions(+), 711743 deletions(-)

Improvements:
  simplifycfg.NumHoistCommonCode 839380 -> 879480 +4.78%
  simplifycfg.NumHoistCommonInstrs 2432089 -> 2508763 +3.15%
  simplifycfg.NumLookupTablesHoles 2446 -> 2447 +0.04%
  instcombine.NumConstProp 156985 -> 157025 +0.03%
  simplifycfg.NumFoldValueComparisonIntoPredecessors 512370 -> 512441 +0.01%
  instsimplify.NumSimplified 2472478 -> 2472696 +0.01%
  instcombine.NegatorMaxDepthVisited 20081 -> 20082 +0.00%
  correlated-value-propagation.NumDeadCases 65942 -> 65945 +0.00%
  licm.NumLoadStorePromoted 67443 -> 67446 +0.00%
  gvn.IsValueFullyAvailableInBlockNumSpeculationsMax 601823 -> 601848 +0.00%
Regressions:
  simplifycfg.NumSinkCommonInstrs 829938 -> 828953 -0.12%
  constmerge.NumIdenticalMerged 15510 -> 15494 -0.10%
  simplifycfg.NumLookupTables 19508 -> 19491 -0.09%
  simplifycfg.NumSinkCommonCode 378565 -> 378439 -0.03%
  lower-is-constant-intrinsic.ObjectSizeIntrinsicsHandled 27923 -> 27917 -0.02%
  loop-simplify.NumNested 11689 -> 11687 -0.02%
  memdep.NumCacheNonLocal 19746 -> 19743 -0.02%
  memdep.NumUncacheNonLocal 25297 -> 25294 -0.01%
  adce.NumBranchesRemoved 23080 -> 23078 -0.01%
  sccp.NumDeadBlocks 685312 -> 685276 -0.01%

+8 proxygen/HQFramer.ll
+3 graphviz/parse.ll
+3 nix/get-drvs.ll
+3 postgres/pg_dump.ll
+3 proxygen/StructuredHeadersBuffer.ll
+1 curl/tftp.ll
+0 lua/lua.ll
+0 miniaudio/unity.ll
+0 tomlplusplus/toml.ll
+0 wasmtime-rs/4bsmuvpz9r22ks1w.ll
-1 clamav/extract.ll
-1 cmake/SystemTools.ll
-1 curl/imap.ll
-1 duckdb/ub_duckdb_core_functions_date.ll
-1 ffmpeg/hw_base_encode_h264.ll
-1 fish-rs/1f6psxxy03bde21s751lsgfn2.ll
-1 fish-rs/8zxt2gjt68ikxu18thf3foa45.ll
-1 folly/LogName.ll
-1 glslang/ShaderLang.ll
-1 hwloc/traversal.ll
-1 llvm/Lexer.ll
-1 llvm/RISCVISelDAGToDAG.ll
-1 nlohmann_json/unit-disabled_exceptions.ll
-1 opencv/persistence_xml.ll
-1 openjdk/c1_LIRGenerator.ll
-1 openjdk/constantPool.ll
-1 openjdk/macroArrayCopy.ll
-1 openssl/opt.ll
-1 openssl/statem_lib.ll
-1 osqp/auxil.ll
-1 slurm/job_mgr.ll
-1 uv-rs/a6ilto48eiq73sc4zhyd8fwow.ll
-1 z3/mpf.ll
-2 assimp/PlyLoader.ll
-2 bullet3/btSimulationIslandManagerMt.ll
-2 chibicc/codegen.ll
-2 cmake/CommandLineArguments.ll
-2 cpython/_localemodule.ll
-2 cvc5/logic_info.ll
-2 darktable/export.ll
-2 darktable/gtk.ll
-2 darktable/imageio_libraw.ll
-2 ffmpeg/cbs_av1.ll
-2 hermes/CommandLine.ll
-2 icu/smpdtfst.ll
-2 linux/bus-fixup.ll
-2 llvm/CGCleanup.ll
-2 pola-rs/craaq0nmso5si1vuneoip44el.ll
-2 raylib/rcore.ll
-2 redis/bitops.ll
-2 rust-analyzer-rs/2jezmucvqvfiuhvx.ll
-2 rust-analyzer-rs/wcknfmhk1hydgx3.ll
-2 slurm/parse_time.ll
-2 typst-rs/18cop7j4xops9f9h.ll
-2 uv-rs/ave40xak3nbjmbyk2qlq8h4r3.ll
-2 wasmedge/refInstr.ll
-2 wasmedge/validator.ll
-2 wireshark/packet-drda.ll
-2 z3/smt2scanner.ll
-3 c3c/sema_expr.ll
-3 cmake/cmGlobalGenerator.ll
-3 git/path.ll
-3 hermes/gtest-all.ll
-3 meshlab/edit_paint.ll
-3 mitsuba3/bitmap.ll
-3 opencv/ts_gtest.ll
-3 openjdk/diagnosticArgument.ll
-3 php/str.ll
-3 raylib/rtextures.ll
-3 rocksdb/sst_file_dumper.ll
-3 sdl/SDL_gamepad.ll
-3 spike/socketif.ll
-4 abc/abcBlifMv.ll
-4 bdwgc/gc.ll
-4 cpython/flowgraph.ll
-4 ffmpeg/matroskadec.ll
-4 flatbuffers/idl_parser.ll
-4 icu/ucol_sit.ll
-4 llvm/FunctionAttrs.ll
-4 minetest/nodedef.ll
-4 php/rfc1867.ll
-4 rocksdb/string_util.ll
-4 ruby/ractor.ll
-4 rustfmt-rs/4arc02n7xt9gqo2v.ll
-4 verilator/V3String.ll
-4 verilator/V3Width.ll
-4 zed-rs/0b032pjjfhzfqpvy5k7rem7aa.ll
-4 zed-rs/9r3tgj00e2sbbyanbvf1oqgns.ll
-5 cvc5/cvc5.ll
-5 hdf5/H5Spoint.ll
-5 hyperscan/cpuid_flags.ll
-5 llvm/InstCombineCompares.ll
-5 minetest/c_packer.ll
-5 pola-rs/4e0hf67d1zghwocjlymu8g39x.ll
-5 rust-analyzer-rs/hajha7nvyoiczny.ll
-6 abc/abcExact.ll
-6 clamav/pathfn.ll
-6 ffmpeg/vaapi_vpp.ll
-6 hermes/APInt.ll
-6 linux/hooks.ll
-6 opencv/persistence_json.ll
-6 tls-rs/4klah4jfox7oqufu.ll
-7 ffmpeg/ac3enc.ll
-7 icu/uniset_props.ll
-7 openssl/extensions_clnt.ll
-8 abc/abcUtil.ll
-8 boost/debug.ll
-8 diesel-rs/221gzbx6n2968mg0.ll
-8 libcxx/future.ll
-8 protobuf/csharp_helpers.ll
-9 cpython/Hacl_Hash_SHA3.ll
-9 diesel-rs/30cx9e85d8viwtnf.ll
-9 diesel-rs/3y4xw1qwrjmgl19p.ll
-9 linux/earlycon.ll
-11 php/mail.ll
-12 openspiel/twixt.ll
-13 minetest/s_base.ll
-32 node/libnode.Protocol.ll
-42 eastl/EASprintfCore.ll

@github-actions
Copy link
Contributor

The provided diff includes changes across multiple LLVM IR files, primarily focusing on code simplification, optimization, and restructuring. Below is a summary of the major changes observed:

  1. Phi Node Source Updates: Several phi instructions have their incoming block labels updated to reflect new control flow paths. For example, in abcBlifMv.ll, %indvars.iv95 and %18 now reference %65 instead of %69, indicating a change in loop structure or edge redirection.

  2. Switch Statement Reorganization: Multiple functions replace direct branching with precomputed labels or restructure switch cases for better optimization. For instance, in boost/debug.ll, a sequence of basic blocks handling string parsing is refactored into a more streamlined loop with .critedge.preheader, reducing redundancy.

  3. Load/Store Optimization: Redundant loads are eliminated or hoisted. In bdwgc/gc.ll, the multiplication result %.029 * %.030 is computed once and reused across multiple branches instead of being recalculated, improving performance.

  4. Control Flow Simplification: Complex branching logic is simplified. In chibicc/codegen.ll, switch statements are adjusted to use updated label names and eliminate unnecessary blocks, streamlining the control flow graph.

  5. Lifetime Management Adjustments: Calls to llvm.lifetime.start/end are reordered or added to ensure correct stack variable tracking, as seen in diesel-rs files, where lifetime intrinsics are placed appropriately around critical sections.

These changes collectively aim to improve code efficiency, reduce redundancy, and enhance optimization potential by clarifying data flow and control dependencies.

model: qwen-plus-latest
CompletionUsage(completion_tokens=344, prompt_tokens=104965, total_tokens=105309, completion_tokens_details=None, prompt_tokens_details=None)

Comment on lines -515 to -517
%.sink = phi i8 [ 1, %sw.epilog ], [ 1, %sw.bb ], [ 2, %if.then ]
%which_.i.i.i8 = getelementptr inbounds nuw i8, ptr %agg.result, i64 16
store i8 %.sink, ptr %which_.i.i.i8, align 8
Copy link

Choose a reason for hiding this comment

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

Regression: Early hoisting of %which_.i.i.i8 = getelementptr inbounds nuw i8, ptr %agg.result, i64 16 hinders the sinking of these code?

Comment on lines +596 to +603
sw.bb.i: ; preds = %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i, %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i, %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i, %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i, %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i, %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i, %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i, %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i, %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i
%6 = load i64, ptr %settingValue.i, align 8, !noalias !13
store i64 %6, ptr %settingValue, align 8, !alias.scope !13
br label %invoke.cont34

sw.epilog.i: ; preds = %_ZN5folly8OptionalISt4pairImmEEptEv.exit5.i
store i8 0, ptr %settingValue, align 8, !alias.scope !13
br label %invoke.cont34
Copy link

@Camsyn Camsyn Oct 30, 2025

Choose a reason for hiding this comment

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

Seems like positive: 2 new blocks representing different operations and invoke.cont34 representing the identical operations.

Previously, these identical operations were duplicated in block invoke.cont34 and invoke.cont40.

I.e.,
Before:

invoke.cont34:
   // OP1
   // Idenetical OPs
   to cleanup
invoke.cont40:
   // OP2
   // Identical OPs
   // OP3

After:

sw.bb.i:
   // OP1
   to invoke.cont34
sw.epilog.i:
   // OP2
   to invoke/cont34
invoke.cont34:
   // identical OPs
   conditional to invoke.cont40 / cleanup
invoke.cont40:
   // OP3

invoke.cont34: ; preds = %sw.epilog.i, %sw.bb.i
%.sink = phi i8 [ 0, %sw.epilog.i ], [ 1, %sw.bb.i ]
store i8 %.sink, ptr %hasValue.i.i.i.i.i.i, align 8, !alias.scope !13
store i8 1, ptr %which_.i.i.i.i, align 8, !alias.scope !13
Copy link

@Camsyn Camsyn Oct 30, 2025

Choose a reason for hiding this comment

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

This store is useless to successor %cleanup, although it is a cold path to reach %cleanup

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants