Skip to content

Conversation

@zyw-bot
Copy link
Collaborator

@zyw-bot zyw-bot commented Sep 9, 2025

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

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

zyw-bot commented Sep 9, 2025

Diff mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@192d13e
patch: llvm/llvm-project#157030
sha256: 3615f51a45b19c57fdd8a55174f1ffd5a702c6778701be274e24e1edc55aae2b
commit: aa2c038

35 files changed, 3099 insertions(+), 3201 deletions(-)

Improvements:
  simplifycfg.NumSpeculations 408033 -> 408035 +0.00%
  instcombine.NumDeadInst 42524452 -> 42524561 +0.00%
  instcombine.NumCombined 125674505 -> 125674610 +0.00%
Regressions:
  instcombine.NumSunkInst 3485171 -> 3485161 -0.00%

1 3 bench/c3c/optimized/c_abi.ll
4 12 bench/libigl/optimized/closest_facet.ll
3 9 bench/lightgbm/optimized/c_api.ll
7 8 bench/llvm/optimized/CGObjCMac.ll
2 6 bench/meshlab/optimized/alignset.ll
7 21 bench/nix/optimized/primops.ll
5 15 bench/nix/optimized/trivial.ll
9 17 bench/ocio/optimized/GammaOpData.ll
10 11 bench/wasmedge/optimized/controlInstr.ll
1 2 bench/wasmtime-rs/optimized/2ly4gzztxx8hlwxv.ll
9 11 bench/wireshark/optimized/packet-ehdlc.ll
84 89 bench/wireshark/optimized/packet-ieee1722.ll

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

The patch replaces several sequences of bit manipulation operations with simpler and more direct comparisons. The key changes are:

  1. Replace bit-shifting and masking with direct equality comparisons: In multiple files (e.g., c_abi.ll, closest_facet.ll, c_api.ll, primops.ll, trivial.ll, controlInstr.ll, packet-ehdlc.ll, 2ly4gzztxx8hlwxv.ll), patterns involving trunc, lshr, and zext to extract and test specific bits are replaced with direct icmp eq instructions. For example, testing whether a value is 7, 2, 1, etc., is now done with icmp eq i8 %val, 7 instead of shifting a mask and truncating.

  2. Use of and + icmp eq for bit testing: In CGObjCMac.ll and controlInstr.ll, instead of using lshr with a large constant and truncating, the code now uses and to isolate bits followed by an equality comparison. For instance, %switch.masked = icmp eq i32 %100, 0 where %100 = and i32 %val, 6 tests whether specific bits are clear.

  3. Simplify conditional logic with icmp ult and select: In GammaOpData.ll, multiple switch blocks that used bit manipulation to compute boolean flags are replaced with direct icmp ult comparisons and select instructions, reducing complexity and improving clarity.

  4. Fix and simplify control flow in packet-ieee1722.ll: The switch block is cleaned up by replacing bit-shifting and truncation with direct unsigned comparisons (icmp ugt, icmp ult) to test bit ranges, and basic block labels and PHI nodes are corrected to reflect new control flow.

  5. Adjust PHI node predecessors and labels due to control flow changes: In several files (e.g., wireshark benchmarks), label and PHI node updates reflect modified control flow paths after simplifying conditional branches.

Overall, the changes simplify bit-testing logic, improve readability, and likely enhance performance by reducing instruction count and complexity.

model: qwen-plus-latest
CompletionUsage(completion_tokens=468, prompt_tokens=17755, total_tokens=18223, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Sep 10, 2025
@dtcxzyw dtcxzyw deleted the test-run17569878226 branch September 14, 2025 15:19
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