Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

pre-commit: PR178977#3410

Closed
zyw-bot wants to merge 3 commits intomainfrom
test-run21532638376
Closed

pre-commit: PR178977#3410
zyw-bot wants to merge 3 commits intomainfrom
test-run21532638376

Conversation

@zyw-bot
Copy link
Copy Markdown
Collaborator

@zyw-bot zyw-bot commented Jan 30, 2026

Link: llvm/llvm-project#178977
Requested by: @andjo403

@github-actions github-actions Bot mentioned this pull request Jan 30, 2026
@zyw-bot
Copy link
Copy Markdown
Collaborator Author

zyw-bot commented Jan 30, 2026

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@f3d81d4
patch: llvm/llvm-project#178977
sha256: 4c63fc33cbc6993f5deff09103049bf6efb17b1f4fc3a2f772f7e0798e5d2edd
commit: 137c710

6972 files changed, 16132942 insertions(+), 16930863 deletions(-)

Improvements:
  instcount.NumTruncInst 2076616 -> 2943530 +41.75%
  dse.NumCFGTries 54932 -> 56378 +2.63%
  local.NumRemoved 5278722 -> 5385390 +2.02%
  aggressive-instcombine.NumInstrsReduced 44818 -> 45509 +1.54%
  dse.NumCFGChecks 635061 -> 641199 +0.97%
  loop-simplifycfg.NumLoopBlocksDeleted 6845 -> 6904 +0.86%
  aggressive-instcombine.NumExprsReduced 15543 -> 15666 +0.79%
  jump-threading.NumDupes 131968 -> 132997 +0.78%
  instcount.NumLShrInst 1226843 -> 1236178 +0.76%
  basicaa.SearchLimitReached 4775 -> 4811 +0.75%
Regressions:
  instcount.NumAndInst 3895756 -> 3030471 -22.21%
  aggressive-instcombine.NumAnyOrAllBitsSet 78 -> 70 -10.26%
  instcombine.NumConstProp 168468 -> 155130 -7.92%
  early-cse.NumCSE 5557092 -> 5191002 -6.59%
  instcount.NumICmpInst 24655357 -> 23793745 -3.49%
  memdep.NumCacheNonLocalPtr 266849257 -> 259026818 -2.93%
  indvars.NumElimIdentity 1865 -> 1833 -1.72%
  licm.NumBOAssociationsHoisted 3511 -> 3472 -1.11%
  memdep.NumCacheCompleteNonLocalPtr 5346165 -> 5306193 -0.75%
  correlated-value-propagation.NumAddNSW 216353 -> 214984 -0.63%

+24 cmake/cmSystemTools.ll
+3 cmake/cmGlobalGenerator.ll
+3 hyperscan/ue2string.ll
+2 openspiel/SolverIF.ll
+2 postgres/nbtree.ll
+1 abc/giaLf.ll
+1 abc/giaMf.ll
+1 ffmpeg/dnxhddata.ll
+1 libwebp/muxread.ll
+1 recastnavigation/main.ll
+1 yosys/extract_counter.ll
-1 abc/darLib.ll
-1 abc/giaOf.ll
-1 abseil-cpp/flag.ll
-1 box2d/sample_world.ll
-1 c3c/bigint.ll
-1 clamav/file.ll
-1 cmake/cf-socket.ll
-1 coremark/core_main.ll
-1 csmith/CVQualifiers.ll
-1 darktable/introspection_channelmixerrgb.ll
-1 draco/mesh_stripifier.ll
-1 duckdb/dfa.ll
-1 fish-rs/djai6kkt8m7zi9lpt05bwt9kh.ll
-1 foundations-rs/0uhtkdzva2a9kciz5ikpsa8ze.ll
-1 foundations-rs/arf09deisv3jfcmugkb162mqc.ll
-1 git/name-hash.ll
-1 graphviz/textspan.ll
-1 hdf5/H5SM.ll
-1 hwloc/topology.ll
-1 hyperscan/compiler.ll
-1 hyperscan/rose_build_convert.ll
-1 jsonnet/vm.ll
-1 libevent/bufferevent_mbedtls.ll
-1 libevent/bufferevent_sock.ll
-1 libquic/ssl_session.ll
-1 lief/psa_crypto.ll
-1 memcached/slabs_mover.ll
-1 meshlab/filterqualitymapper.ll
-1 nori/colorwheel.ll
-1 openblas/dtrsm_ilnucopy.ll
-1 openexr/IexMathFpu.ll
-1 openexr/ImfInputFile.ll
-1 quiche-rs/6lp2oyapnsojevo64mk9ap806.ll
-1 re2/nfa.ll
-1 redis/cluster.ll
-1 redis/socket.ll
-1 redis/t_hash.ll
-1 salsa-rs/94p3zttdpmom32e3r01j32kzw.ll
-1 sentencepiece/arena.ll
-1 slurm/reservation.ll
-1 softposit-rs/1jooigl29qhneyer.ll
-1 softposit-rs/oveg98n4r9tnk39.ll
-1 stb/stb_vorbis.ll
-1 typst-rs/2i78fvbm4wocuesi.ll
-1 typst-rs/3kgmqnxcsl3z3n0n.ll
-1 uv-rs/82fpu1t5cgt0yipszry5bzum9.ll
-1 wasmedge/wasmedge.ll
-1 wolfssl/ssl.ll
-1 xgboost/loop.ll
-1 zxing/zueci.ll
-2 actix-rs/14bh10sj718x2c7a.ll
-2 arrow/bitmap.ll
-2 assimp/X3DImporter.ll
-2 boost/cpp_main.ll
-2 clap-rs/46qpaucouebcxfrx.ll
-2 duckdb/parquet_statistics.ll
-2 faiss/sysinfo.ll
-2 ffmpeg/asfdec_f.ll
-2 graphviz/poly.ll
-2 hdf5/h5dump_ddl.ll
-2 html5ever-rs/126f7y4y0nk6dpjh.ll
-2 libevent/evdns.ll
-2 meshlab/editpickpoints.ll
-2 mitsuba3/blackbody.ll
-2 nanobind/test_stl.ll
-2 openssl/x_int64.ll
-2 protobuf/tokenizer.ll
-2 quinn-rs/em94uyxz0wp9gccfab963606p.ll
-2 sentencepiece/implicit_weak_message.ll
-2 slurm/job_mgr.ll
-2 tokio-rs/1k577qo9p6sw2dlc.ll
-2 tokio-rs/3nmgzybx6iv04snk.ll
-2 tree-sitter-rs/76by25jz7vi08g1.ll
-2 yara-x-rs/cuynzwkmf4lxp81cl2zzl1pa9.ll
-3 arrow/page.ll
-3 bullet3/btDiscreteDynamicsWorld.ll
-3 clap-rs/48fdpr2dy8inq5cq.ll
-3 curl/http.ll
-3 entt/meta_any.ll
-3 jiff-rs/9izaa421s43j4ihx0iahajgea.ll
-3 libcxx/random.ll
-3 lief/GnuHash.ll
-3 mitsuba3/object.ll
-3 openvdb/TempFile.ll
-3 pola-rs/8mjg4tlt628xep4awqt0660mt.ll
-3 quest/QuEST_validation.ll
-4 arrow/bit_run_reader.ll
-4 libcxx/future.ll
-4 lightgbm/gbdt_prediction.ll
-4 mold/arena_slot.ll
-4 quantlib/cevrndcalculator.ll
-4 recastnavigation/imgui.ll
-4 sentencepiece/generated_message_table_driven_lite.ll
-4 velox/UnsafeRowFast.ll
-5 bullet3/btSimpleDynamicsWorld.ll
-5 libquic/source_address_token.pb.ll
-5 libzmq/socket_base.ll
-5 mimalloc/page.ll
-5 mold/parallel_pipeline.ll
-5 recastnavigation/catch_amalgamated.ll
-5 vcpkg/catch.ll
-5 velox/CompactRow.ll
-5 zxing/QRVersion.ll
-6 coreutils-rs/3xc4e7mmntf4esc6.ll
-6 gromacs/plot.ll
-6 msdfgen/MSDFErrorCorrection.ll
-6 regex-rs/4sqmacerw61c696o.ll
-6 rocksdb/compaction_iterator.ll
-6 sentencepiece/arenastring.ll
-6 sentencepiece/sentencepiece.pb.ll
-7 glslang/Pp.ll
-7 node/libnode.node_snapshotable.ll
-7 openspiel/rbc.ll
-8 delta-rs/11f8x98axanecwnw.ll
-8 eastl/TestBitVector.ll
-8 mini-lsm-rs/211qm7emy1a6xqse.ll
-8 openssl/tls-provider.ll
-8 sdl/SDL_render.ll
-8 spike/lh.ll
-10 eastl/TestAtomicBasic.ll
-11 libquic/quic_session.ll
-17 velox/Filter.ll

@github-actions
Copy link
Copy Markdown
Contributor

This patch introduces several targeted optimizations across many benchmarks, primarily focused on improving bit-test efficiency and cleaning up redundant operations. Here are the five major changes:

  1. Replacement of and+icmp with trunc for single-bit extraction: Across numerous files (e.g., darLib.ll, giaLf.ll, abseil-cpp/flag.ll, actix-rs/...ll, arrow/...ll, clap-rs/...ll, eastl/...ll, entt/...ll, faiss/...ll, ffmpeg/...ll, hdf5/...ll, hwloc/...ll, jsonnet/...ll, libcxx/...ll, libevent/...ll, libquic/...ll, libwebp/...ll, libzmq/...ll, lief/...ll, lightgbm/...ll, mimalloc/...ll, mini-lsm-rs/...ll, mitsuba3/...ll), patterns like %x = and <T> %val, 1 followed by %y = icmp ne <T> %x, 0 (or eq) are replaced with %y = trunc <T> %val to i1. This is a canonical, more efficient way to extract the least-significant bit as a boolean.

  2. Refinement of bit-field logic in bit manipulation routines: In arrow/bit_run_reader.ll and arrow/bitmap.ll, complex sequences for testing individual bits (e.g., shl + and or zext + trunc + and) are simplified to direct lshr + trunc or lshr + and + trunc. This streamlines bit access patterns used in bitmap and bit-stream processing.

  3. Optimization of conditional branching based on bit tests: In abc/optimized/giaLf.ll, abc/optimized/giaMf.ll, and box2d/optimized/sample_world.ll, branches that previously used an and+icmp pair to test a flag bit now use the more direct trunc-to-i1 result, and the branch targets are reordered for clarity (e.g., br i1 %cond, label %true, label %false instead of the inverse).

  4. Simplification of boolean logic in control flow: Several locations (e.g., cmake/cmGlobalGenerator.ll, curl/http.ll, duckdb/parquet_statistics.ll, hdf5/H5SM.ll, hyperscan/ue2string.ll) replace multi-step boolean computations (like and+or+select) with simpler or/and/xor instructions operating directly on i1 values, improving readability and potentially enabling further optimization.

  5. Correction of phi node operand ordering and critical edge handling: In multiple files (cmake/cmSystemTools.ll, draco/mesh_stripifier.ll, duckdb/dfa.ll, faiss/sysinfo.ll, fish-rs/...ll, foundations-rs/...ll, graphviz/poly.ll, gromacs/plot.ll, hdf5/h5dump_ddl.ll, hwloc/topology.ll, jiff-rs/...ll, libzmq/socket_base.ll, meshlab/editpickpoints.ll, mimalloc/page.ll), phi node operands and critical edge predecessor lists have been reordered to match the actual control flow graph, fixing potential miscompilations or undefined behavior related to incorrect SSA construction.

model: qwen-plus-latest
CompletionUsage(completion_tokens=791, prompt_tokens=110515, total_tokens=111306, completion_tokens_details=None, prompt_tokens_details=None)


Abc_TtNot.exit: ; preds = %.lr.ph.i122, %Abc_TtExpand.exit113, %Abc_TtMux.exit
%401 = phi i32 [ 0, %Abc_TtExpand.exit113 ], [ 0, %Abc_TtMux.exit ], [ 1, %.lr.ph.i122 ]
%401 = phi i32 [ 0, %Abc_TtExpand.exit113 ], [ %.mux, %Abc_TtMux.exit ], [ 1, %.lr.ph.i122 ]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Perhaps we can infer the constant in computeKnownBitsFromCond.

%.not156.i = trunc i16 %.pre.i to i1
%85 = and i32 %84, 16
%.not157.i = icmp eq i32 %85, 0
%or.cond170.i = and i1 %.not157.i, %.not156.i
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Isn't it handled by llvm/llvm-project#171195?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the pattern that was handed in that PR was icmp eq (trunc to iX) , 0
but this pattern hade been handled if the the zext was not there as decomposeBitTestICmp do not look through that

@dtcxzyw dtcxzyw closed this Feb 2, 2026
@dtcxzyw dtcxzyw deleted the test-run21532638376 branch February 2, 2026 19:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants