Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

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

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

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

zyw-bot commented Dec 5, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@5e4974f
patch: llvm/llvm-project#170896
sha256: 93cbf46bde86ce5f6785884ca3d846e2e51acc038707b2316e6cf2f6fd2cd1d6
commit: 8ab8b59

9 files changed, 37991 insertions(+), 38729 deletions(-)

Improvements:
  instcombine.NegatorTotalNegationsAttempted 20583164 -> 20588562 +0.03%
  instcombine.NegatorNumValuesVisited 21501323 -> 21506721 +0.03%
  globalopt.NumDeleted 1055643 -> 1055651 +0.00%
  correlated-value-propagation.NumPhis 1237642 -> 1237648 +0.00%
  last-run-tracking.NumSkippedPasses 48727836 -> 48727893 +0.00%
  jump-threading.NumFolds 2547435 -> 2547436 +0.00%
  instcombine.NumDeadInst 41027893 -> 41027896 +0.00%
  early-cse.NumSimplify 28516981 -> 28516982 +0.00%
Regressions:
  correlated-value-propagation.NumOverflows 4350 -> 4338 -0.28%
  correlated-value-propagation.NumSubNUW 37057 -> 37045 -0.03%
  correlated-value-propagation.NumSubNW 114154 -> 114130 -0.02%
  correlated-value-propagation.NumSubNSW 77534 -> 77522 -0.02%
  correlated-value-propagation.NumNW 948971 -> 948947 -0.00%
  correlated-value-propagation.NumNSW 565468 -> 565456 -0.00%
  correlated-value-propagation.NumNUW 571062 -> 571050 -0.00%
  globalsmodref-aa.NumNoMemFunctions 768656 -> 768648 -0.00%
  globalsmodref-aa.NumReadMemFunctions 1184249 -> 1184241 -0.00%
  instcombine.NumOneIteration 61999680 -> 61999623 -0.00%

-11 evmone/tracing.ll
-19 evmone/advanced_instructions.ll

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Here are the 5 major changes in this patch:

  1. Replacement of @llvm.usub.with.overflow.i64 intrinsics with explicit sub + icmp ult sequences: Multiple loops (e.g., in advanced_instructions.ll and tracing.ll) replace calls to the overflow intrinsic with manual unsigned subtraction (sub) and overflow detection via icmp ult, eliminating dependence on the intrinsic and enabling more predictable codegen.

  2. Removal of unused @llvm.usub.with.overflow.i64 declaration: The function declaration for @llvm.usub.with.overflow.i64 is deleted from both files, reflecting that the intrinsic is no longer used anywhere in the optimized IR.

  3. Loop phi node and branch target updates due to control-flow restructuring: Several loop headers and back-edges are updated (e.g., %98%96, %32%30, %70%66) to reflect new loop structure after optimization—likely resulting from loop simplification or tail duplication following the intrinsic removal.

  4. Refactoring of multi-step arithmetic with carry propagation: In functions like submul, udivrem_knuth, and udivrem_3by2, chains of overflow-aware subtractions are replaced by simpler arithmetic + explicit carry logic (e.g., sub + icmp ult + zext + sub), improving readability and potentially enabling better optimization downstream.

  5. Consolidation and cleanup of large integer (128-bit) assembly logic: In udivrem_3by2 and related functions, redundant bit-shifts and or disjoint patterns are simplified (e.g., reordering shl/zext/or), and phi node operands are updated to match revised basic block predecessors—indicating improved SROA or scalar evolution post-optimization.

All changes are consistent with a broader optimization pass targeting removal of overflow intrinsics in favor of canonical, lower-level arithmetic and comparison operations—improving portability, analysis fidelity, and backend codegen opportunities.

model: qwen-plus-latest
CompletionUsage(completion_tokens=445, prompt_tokens=25436, total_tokens=25881, completion_tokens_details=None, prompt_tokens_details=None)

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