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

pre-commit: PR184246 - #3529

Closed
zyw-bot wants to merge 3 commits into
mainfrom
test-run22598385178
Closed

pre-commit: PR184246#3529
zyw-bot wants to merge 3 commits into
mainfrom
test-run22598385178

Conversation

@zyw-bot

@zyw-bot zyw-bot commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

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

@github-actions github-actions Bot mentioned this pull request Mar 2, 2026
@zyw-bot

zyw-bot commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator Author

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@ebe3c1e
patch: llvm/llvm-project#184246
sha256: 9e45465e198cff46a18fadba650560618613935a529fe902d5343a5a5ed6186f
commit: 3c8d9be

7 files changed, 7810 insertions(+), 7855 deletions(-)

Improvements:
  aggressive-instcombine.NumAnyOrAllBitsSet 70 -> 79 +12.86%
  indvars.NumInvariantCmp 335 -> 337 +0.60%
  simple-loop-unswitch.NumCostMultiplierSkipped 17241 -> 17243 +0.01%
  instcombine.NumFactor 46658 -> 46662 +0.01%
  instcount.NumFreezeInst 55945 -> 55947 +0.00%
  loop-instsimplify.NumSimplified 182375 -> 182381 +0.00%
  indvars.NumReplaced 69496 -> 69498 +0.00%
  simple-loop-unswitch.NumBranches 104946 -> 104948 +0.00%
  correlated-value-propagation.NumAddNUW 210865 -> 210868 +0.00%
  instcombine.NumReassoc 277696 -> 277698 +0.00%
Regressions:
  reassociate.NumChanged 4922851 -> 4922720 -0.00%
  instcount.NumOrInst 1142633 -> 1142603 -0.00%
  instcount.NumLShrInst 1229099 -> 1229069 -0.00%
  instcount.NumTruncInst 2935508 -> 2935490 -0.00%
  instcount.NumXorInst 539999 -> 539996 -0.00%
  local.NumPHICSEs 185363 -> 185362 -0.00%
  instcount.NumShlInst 1394878 -> 1394874 -0.00%
  simplifycfg.NumSinkCommonCode 376289 -> 376288 -0.00%
  loop-rotate.NumInstrsDuplicated 3015029 -> 3015021 -0.00%
  simplifycfg.NumSinkCommonInstrs 823145 -> 823143 -0.00%

-3 llvm/SMTConstraintManager.ll
-26 fish-rs/2jegnuo3b7uy1oojff5kt8alk.ll

@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Here's a concise summary of the major changes in this LLVM IR diff:

  1. Simplified bit-field extraction and condition logic in _ZN4fish12input_common16InputEventQueuer9parse_csi...:
    The original code performed multiple lshr/trunc operations to extract individual byte fields from an i40 value (%.sroa.3.0.extract.shift21, %.sroa.6.0.extract.shift23, etc.), followed by complex boolean logic involving or, xor, and icmp ne. The patch eliminates most of those extractions and replaces the condition with a single masked and i40 %9, 4311744769 (≈ 0x100A0001) and icmp eq against 4294967296 (0x10000000), significantly reducing instruction count and control flow complexity.

  2. Elimination of redundant phi node inputs and basic blocks:
    The .sroa.414.0 phi node is now fed only from %3 and %15 (previously %3 and %17), and the branch target labels are renumbered and merged (e.g., %16%12, %17%15). This reflects CFG simplification — likely due to dead code elimination or more aggressive jump-threading after the logic rewrite.

  3. Optimized bit-packing for KeyEvent::with_shifted_codepoint:
    The multi-step or disjoint sequence building a 32-bit value from shifted/truncated fields is replaced with a single and i32 %13, -16711681 (i.e., 0xFF00FFFF) followed by or disjoint with the shifted i8→i32 value. This preserves the intended bit layout (masking out bits 8–15) while removing 5+ intermediate instructions and unnecessary truncations/shifting.

  4. Consistent transformation across duplicated function bodies:
    Identical optimizations are applied to two nearly identical copies of the same function (at offsets ~39582 and ~39631), indicating the change targets a common code pattern—likely resulting from inlining or template instantiation—and was applied uniformly post-optimization.

  5. Cleanup in SMTConstraintManager::checkModel:
    In SMTConstraintManager.ll, the unused lshr i16 %25, 8 (.sroa.5.0.extract.shift) is removed. The branching logic around %28 == 257 / == 256 is streamlined: redundant trunc/xor/and chains are replaced with direct and+icmp pairs, and the CFG is flattened (e.g., %35%33, %39%37), reducing block count and improving predictability.

Overall, these changes reflect aggressive peephole and DAG-combining optimizations—replacing verbose, multi-instruction bit manipulations with compact, semantically equivalent patterns—leading to smaller, faster, and more analyzable IR.

model: qwen-plus-latest
CompletionUsage(completion_tokens=711, prompt_tokens=4756, total_tokens=5467, completion_tokens_details=None, prompt_tokens_details=None)

@andjo403

andjo403 commented Mar 4, 2026

Copy link
Copy Markdown

/add-label reviewed

@andjo403

andjo403 commented Mar 4, 2026

Copy link
Copy Markdown

/close

@github-actions github-actions Bot closed this Mar 4, 2026
@dtcxzyw
dtcxzyw deleted the test-run22598385178 branch March 5, 2026 16:59
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.

2 participants