Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

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

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

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

zyw-bot commented Oct 17, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@0fdfad3
patch: llvm/llvm-project#163628
sha256: 23eae4e720d9da14c1104a0b01fc73eb3759e4f3d6a494efa29e60aeaafc6e31
commit: e502a2f

75 files changed, 7318 insertions(+), 7303 deletions(-)

Improvements:
  correlated-value-propagation.NumPhiCommon 53267 -> 53277 +0.02%
  instsimplify.NumSimplified 2473584 -> 2473695 +0.00%
  lcssa.NumLCSSA 15170295 -> 15170742 +0.00%
  correlated-value-propagation.NumCmps 272070 -> 272074 +0.00%
  correlated-value-propagation.NumPhis 1240067 -> 1240085 +0.00%
  gvn.NumGVNSimpl 4423806 -> 4423858 +0.00%
  instcombine.NumSunkInst 3401543 -> 3401576 +0.00%
  indvars.NumWidened 244994 -> 244996 +0.00%
  indvars.NumElimIV 250652 -> 250654 +0.00%
  instcombine.NumCombined 120789905 -> 120790809 +0.00%
Regressions:
  correlated-value-propagation.NumNSW 569866 -> 569843 -0.00%
  sccp.NumInstRemoved 1953307 -> 1953230 -0.00%
  loop-instsimplify.NumSimplified 180934 -> 180927 -0.00%
  simple-loop-unswitch.NumBranches 104327 -> 104324 -0.00%
  sccp.NumDeadBlocks 685505 -> 685486 -0.00%
  indvars.NumReplaced 69159 -> 69158 -0.00%
  gvn.NumGVNEqProp 426810 -> 426805 -0.00%
  early-cse.NumCSE 5562311 -> 5562292 -0.00%
  indvars.NumLFTR 319117 -> 319116 -0.00%
  simplifycfg.NumFoldBranchToCommonDest 747072 -> 747070 -0.00%

+20 rust-analyzer-rs/2mbx5ptcpq6fo7sc.ll
+16 delta-rs/2n0ez5zuwgs53clg.ll
+15 abseil-cpp/float_conversion.ll
+3 fmt/format-impl-test.ll
+3 pingora-rs/bvwglp2tpp41rgrf36efmuws6.ll
+0 abseil-cpp/arg.ll
+0 abseil-cpp/charconv.ll
+0 abseil-cpp/duration.ll
+0 arrow/value_parsing.ll
+0 boost/approximately_equals.ll
+0 boost/to_chars.ll
+0 coreutils-rs/yiho3rob7ld9k5q.ll
+0 duckdb/yyjson.ll
+0 image-rs/5ez7udly19o3uj1p.ll
+0 libigl/coplanar.ll
+0 linux/i915_hwmon.ll
+0 mitsuba3/string.ll
+0 postgres/gindatapage.ll
+0 sentencepiece/repeated_field.ll
+0 wasmedge/wasmedge.ll
+0 yyjson/yyjson.ll
-1 linux/memory.ll
-1 linux/pci.ll
-1 nix/derivations.ll
-1 pola-rs/3x7yowofiwoipixvfrx7sq0eo.ll
-2 image-rs/30755d6iao7ojcvl.ll
-2 typst-rs/1fd2xpfefmgrcb9d.ll
-2 typst-rs/4p46tkw2iv8zjgza.ll
-2 typst-rs/59tuvc5m3xlovl3o.ll
-3 ruff-rs/b7bzulfx0416fsx8nur737ayt.ll
-4 typst-rs/2i78fvbm4wocuesi.ll

@github-actions
Copy link
Contributor

The provided patch introduces several key changes to optimize comparisons and conditionals involving multi-word integers (e.g., i128) by replacing expensive bit-extraction sequences with direct comparisons. Here are the major changes:

  1. Replaced high-bit checks with direct range comparisons: In multiple files (arg.ll, charconv.ll, duration.ll, etc.), checks for non-zero upper 64 bits of an i128 value (via lshr, trunc, and icmp ne) are replaced with a single icmp ult i128 %val, 18446744073709551616 (i.e., comparison against 2^64). This avoids extracting and comparing high bits explicitly.

  2. Optimized conditional logic using or instead of select: Several instances where a select was used to propagate a true condition (e.g., select i1 %cond, i1 true, i1 %other) are replaced with a simpler or i1 %cond, %other, reducing instruction count and complexity.

  3. Simplified 40-bit/48-bit field comparisons: In ruff-rs and typst-rs, comparisons on extracted sub-fields (like .sroa.01.4.extract.trunc) are replaced with direct comparisons on the shifted full-width value (e.g., icmp eq i40 %.sroa.01.4.extract.shift, 2), avoiding truncation.

  4. Optimized small integer comparisons in to_chars.ll: A comparison of a truncated i64 value is replaced with a direct icmp eq i128 against a small constant (500000), likely enabling better constant folding or simplifying control flow.

  5. Improved handling of 24-bit values in coreutils-rs: A sequence that extracts and compares the top byte of a 24-bit value is replaced with a single icmp eq i24 on the shifted value, eliminating unnecessary truncation.

Overall, the changes streamline code that handles packed or wide integer values by leveraging LLVM’s ability to reason about full-width comparisons, reducing the number of instructions and improving performance.

model: qwen-plus-latest
CompletionUsage(completion_tokens=482, prompt_tokens=114547, total_tokens=115029, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Oct 17, 2025
@dtcxzyw dtcxzyw deleted the test-run18594574099 branch October 17, 2025 16:12
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