Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Nov 8, 2025

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

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

zyw-bot commented Nov 8, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@21c1b78
patch: llvm/llvm-project#153053
sha256: 7c1b97cf604d73a63ff2a0d95c413e3df7cd76a2949f42a7596f5ff18203f21e
commit: bb722ad

30 files changed, 8637 insertions(+), 8671 deletions(-)

Improvements:
  globalsmodref-aa.NumNoMemFunctions 768706 -> 768732 +0.00%
  globalsmodref-aa.NumReadMemFunctions 1184361 -> 1184387 +0.00%
  memdep.NumCacheNonLocalPtr 266911387 -> 266912670 +0.00%
  instcombine.NumDeadInst 40907959 -> 40908023 +0.00%
  memdep.NumCacheCompleteNonLocalPtr 5349363 -> 5349370 +0.00%
  gvn.NumPRELoad 948093 -> 948094 +0.00%
  gvn.NumGVNSimpl 4421201 -> 4421203 +0.00%
  memdep.NumUncacheNonLocalPtr 251621224 -> 251621326 +0.00%
  instcombine.NumCombined 120775137 -> 120775162 +0.00%
  instcombine.NumOneIteration 62001339 -> 62001341 +0.00%
Regressions:
  correlated-value-propagation.NumAddNSW 220426 -> 220420 -0.00%
  correlated-value-propagation.NumAddNW 432555 -> 432549 -0.00%
  correlated-value-propagation.NumNSW 569760 -> 569754 -0.00%
  correlated-value-propagation.NumNW 953179 -> 953173 -0.00%
  instcombine.NegatorTotalNegationsAttempted 20584535 -> 20584444 -0.00%
  instcombine.NegatorNumValuesVisited 21502719 -> 21502628 -0.00%
  reassociate.NumChanged 4984813 -> 4984798 -0.00%
  simplifycfg.NumSpeculations 396187 -> 396186 -0.00%
  jump-threading.NumThreads 2698108 -> 2698107 -0.00%
  last-run-tracking.NumSkippedPasses 48743256 -> 48743254 -0.00%

+2 yalantinglibs/server.ll
+1 cmake/hsts.ll
+1 cpython/bytes_methods.ll
+1 curl/altsvc.ll
+1 curl/hsts.ll
+1 ffmpeg/ffv1dec.ll
+1 ffmpeg/ffv1enc.ll
+1 ffmpeg/mov.ll
+1 grpc/utils.ll
+1 openjdk/ifnode.ll
+1 openjdk/imageioJPEG.ll
+0 sqlite/sqlite3.ll
+0 yalantinglibs/client.ll
-1 ffmpeg/mace.ll
-1 grpc/grpc_ares_wrapper.ll
-1 grpc/ping_rate_policy.ll
-1 grpc/tcp_posix.ll
-3 cpython/unicodeobject.ll
-3 libzmq/stream_connecter_base.ll
-5 boost/xml_grammar.ll
-9 php/zend_hash.ll

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2025

The provided diff introduces several changes across multiple benchmark files, primarily focused on replacing manual saturation arithmetic with LLVM's built-in @llvm.sadd.sat intrinsics. Here are the major changes:

  1. Introduction of @llvm.sadd.sat Intrinsics: The most significant change is the replacement of explicit checks for integer overflow (using icmp eq, add, and select) with calls to @llvm.sadd.sat.iN intrinsics (for various bit widths like i8, i16, i32, i64). This simplifies code that performs saturated addition, where the result is clamped to the maximum representable value on overflow.

  2. Simplification of Saturated Addition Patterns: In multiple locations (e.g., xml_grammar.ll, hsts.ll, bytes_methods.ll, unicodeobject.ll, altsvc.ll, ffv1dec.ll, etc.), patterns that manually implement saturated addition are replaced with a single call to @llvm.sadd.sat. For example, sequences checking if a value equals INT_MAX, then conditionally selecting between x+1 and INT_MAX, are replaced with @llvm.sadd.sat(x, 1).

  3. Declaration of New Intrinsic Functions: The patch adds declarations for @llvm.sadd.sat intrinsics for various integer types (i8, i16, i32, i64) in multiple .ll files, indicating their use across different benchmarks.

  4. Code Size and Readability Improvement: By using the intrinsic, the IR becomes more concise and readable, reducing the number of instructions (typically from 3-4 down to 1) for saturated addition operations.

  5. Consistency Across Benchmarks: The change is applied consistently across diverse projects (Boost, CPython, FFmpeg, Curl, gRPC, SQLite, PHP, etc.), suggesting a broad optimization or refactoring effort to leverage LLVM's support for saturation arithmetic.

In summary, the patch modernizes the IR by replacing hand-coded saturated addition with dedicated LLVM intrinsics, improving both clarity and potentially enabling better optimization opportunities.

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

@dtcxzyw dtcxzyw closed this Nov 8, 2025
@dtcxzyw dtcxzyw deleted the test-run19194366164 branch November 8, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants