Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Dec 4, 2025

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

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

zyw-bot commented Dec 4, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@e5603da
patch: llvm/llvm-project#166935
sha256: 1a920680921980b04377b8b40e07c31fbe0a2f9939e63e21e402edd7973f027a
commit: 9699001

530 files changed, 2734063 insertions(+), 2820512 deletions(-)

Improvements:
  instcombine.NumConstProp 155480 -> 168277 +8.23%
  instcombine.NumDeadInst 41001373 -> 41027879 +0.06%
  instcombine.NumOneIteration 61993817 -> 61999680 +0.01%
  instcombine.NumWorklistIterations 61993817 -> 61999680 +0.01%
  globaldce.NumVariables 91234 -> 91238 +0.00%
  local.NumRemoved 5303564 -> 5303715 +0.00%
  simplifycfg.NumHoistCommonCode 839205 -> 839218 +0.00%
  simplifycfg.NumHoistCommonInstrs 2431936 -> 2431958 +0.00%
  instcombine.NumSunkInst 3381565 -> 3381590 +0.00%
  instcombine.NumCombined 120689279 -> 120689642 +0.00%
Regressions:
  last-run-tracking.NumSkippedPasses 48733699 -> 48727836 -0.01%
  instsimplify.NumSimplified 2467326 -> 2467295 -0.00%
  lcssa.NumLCSSA 15128878 -> 15128817 -0.00%
  sroa.NumAllocasAnalyzed 100370512 -> 100370508 -0.00%

+0 libigl/unproject.ll
-4 linux/af_netlink.ll
-4 linux/ioam6.ll
-4 linux/request.ll
-4 linux/sta_info.ll
-4 linux/util.ll
-4 openjdk/screencast_pipewire.ll
-4 postgres/jsonfuncs.ll
-6 lean4/Assumption.ll
-6 lean4/FVarSubset.ll
-6 lean4/FVarSubst.ll
-6 lean4/FilePath.ll
-6 lean4/InlineCandidate.ll
-6 lean4/MVarRenaming.ll
-6 lean4/Position.ll
-6 lean4/expr.ll
-6 lean4/local_ctx.ll
-6 lean4/sharecommon.ll
-8 abc/cuddZddLin.ll
-8 llvm/Z3CrosscheckVisitor.ll
-8 ruby/compile.ll
-9 lean4/Calc.ll
-9 lean4/tcp.ll
-9 meshlab/filter_parametrization.ll
-11 openjdk/methodData.ll
-12 lean4/AndFlatten.ll
-12 lean4/CaseValues.ll
-12 lean4/CollectAxioms.ll
-12 lean4/CollectFVars.ll
-12 lean4/ConstFolding.ll
-12 lean4/Database.ll
-12 lean4/Delta.ll
-12 lean4/EmbeddedConstraint.ll
-12 lean4/External.ll
-12 lean4/HasConstCache.ll
-12 lean4/InputFileConfig.ll
-12 lean4/InternalExceptionId.ll
-12 lean4/Propagate.ll
-12 lean4/Simp.ll
-12 lean4/TZdb.ll
-12 lean4/TypeName.ll
-12 lean4/WorkspaceConfig.ll
-12 lean4/lcnf.ll
-15 lean4/AutoBound.ll
-15 lean4/ExportAttr.ll
-15 lean4/Links.ll
-18 lean4/ByteArray.ll
-18 lean4/ForEachExprWhere.ll
-18 lean4/PlainDateTime.ll
-18 lean4/ReplaceLevel.ll
-18 lean4/Topological.ll
-18 libigl/vertex_triangle_adjacency.ll
-21 ruby/vm.ll
-24 lean4/AuxDeclCache.ll
-24 lean4/AuxLemma.ll
-24 lean4/CSE.ll
-24 lean4/CheckTactic.ll
-24 lean4/Client.ll
-24 lean4/FindLevelMVar.ll
-24 lean4/GeneralizeTelescope.ll
-24 lean4/InitShutdown.ll
-24 lean4/PrettyPrinter.ll
-24 lean4/RequestCancellation.ll
-24 lean4/inductive.ll
-27 wolfssl/sha.ll
-30 lean4/ElimDeadVars.ll
-30 lean4/Encode.ll
-30 lean4/IndGroupInfo.ll
-30 linux/fatent.ll
-36 lean4/Attach.ll
-36 lean4/EligibleHeaderDecls.ll
-57 pingora-rs/acx590v32pn6eo20biyujqd8g.ll

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

  1. Optimized reference counting logic in Lean4 IR: Replaced pointer-to-integer bit-checks (ptrtoint + and) with direct 32-bit refcount loads and comparisons, simplifying lean_dec_ref/lean_inc_ref sequences across dozens of Lean4 benchmark files (e.g., AndFlatten.ll, Assumption.ll, Attach.ll). This eliminates unnecessary pointer arithmetic and improves clarity.

  2. Refactored hash computation in cuddZddLin.ll: Simplified the key hash calculation by replacing two separate (val << 1) | (ptr & 1) patterns with a single truncation + multiplication (trunc i64 → mul i32 25165834), then combining results with add instead of or disjoint. Reduces instruction count and improves arithmetic locality.

  3. Fixed phi node operand indexing in loop exits: Corrected multiple .lcssa.sink and loop-exit phi nodes (e.g., in cuddZddLin.ll at .loopexit466, .loopexit465) to use updated predecessor block labels (e.g., %123, %158) instead of stale ones (%130, %172), ensuring correct SSA value propagation after loop restructuring.

  4. Simplified conditional branching in Lean4 dec/ref helpers: Removed redundant ptrtoint/and null-checks before refcount updates, relying instead on direct icmp sgt i32 %ref, 1 checks and updating phi node predecessor lists accordingly (e.g., lean_dec.exit blocks now list only the relevant entry points, dropping unreachable or obsolete predecessors).

  5. Consolidated memory access patterns in Lean4 box functions: Standardized field access (e.g., loading refcounts from offset 8 instead of 4, aligning with actual object layouts) and removed duplicate ptrtoint/and null checks before cold decrement paths, improving correctness and reducing code size across Array_mapMUnsafe_map, Array_foldlMUnsafe_fold, and similar boxed helper functions.

model: qwen-plus-latest
CompletionUsage(completion_tokens=457, prompt_tokens=98080, total_tokens=98537, completion_tokens_details=None, prompt_tokens_details=None)

@nikic
Copy link

nikic commented Dec 4, 2025

/add-label reviewed
/close

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