Skip to content

Conversation

@dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Mar 19, 2025

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

@github-actions github-actions bot mentioned this pull request Mar 19, 2025
@dtcxzyw
Copy link
Owner Author

dtcxzyw commented Mar 19, 2025

Diff mode

runner: ariselab-64c-v2
baseline: llvm/llvm-project@6dba5f6
patch: llvm/llvm-project#131902
sha256: d6b59de1d33c24e01dc8555c33b77a4e99033b2317aa6eaf7f2e2c2e5daa6ea7
commit: e71ab78

19 files changed, 34549 insertions(+), 34683 deletions(-)

Improvements:
  simplifycfg.NumSinkCommonCode 308089 -> 308123 +0.01%
  simplifycfg.NumSinkCommonInstrs 654335 -> 654403 +0.01%
  instcombine.NumFactor 39304 -> 39308 +0.01%
  instcombine.NumReassoc 252966 -> 252977 +0.00%
  jump-threading.NumThreads 2374214 -> 2374292 +0.00%
  reassociate.NumChanged 4256895 -> 4256947 +0.00%
  instcombine.NumSunkInst 2879985 -> 2880009 +0.00%
  correlated-value-propagation.NumShlNUW 129115 -> 129116 +0.00%
  correlated-value-propagation.NumAddNUW 206142 -> 206143 +0.00%
  correlated-value-propagation.NumPhis 1115026 -> 1115031 +0.00%
Regressions:
  memdep.NumCacheNonLocalPtr 224859852 -> 224859566 -0.00%
  licm.NumHoisted 4567697 -> 4567693 -0.00%
  instcombine.NumOneIteration 40169797 -> 40169764 -0.00%
  last-run-tracking.NumSkippedPasses 45810420 -> 45810419 -0.00%

6 7 bench/actix-rs/optimized/1ghd7r3h0kcgux6d.ll
3 3 bench/actix-rs/optimized/4pmtvrahn6eloepe.ll
2 3 bench/draco/optimized/symbol_encoding.ll
8 8 bench/folly/optimized/EpollBackend.ll
16 16 bench/linux/optimized/open.ll
4 4 bench/linux/optimized/utimes.ll
53 53 bench/quickjs/optimized/libbf.ll
41 50 bench/softposit-rs/optimized/3yl6353p3hwrtv6y.ll
94 105 bench/softposit-rs/optimized/5az6c15ag5q4gib5.ll
190 205 bench/softposit-rs/optimized/oveg98n4r9tnk39.ll
5 6 bench/wireshark/optimized/in_cksum.ll

@github-actions
Copy link
Contributor

Summary of Major Changes in the LLVM IR Diff

1. Bitwise Operations Optimization

  • In multiple files (e.g., b/bench/actix-rs/optimized/1ghd7r3h0kcgux6d.ll, b/bench/folly/optimized/EpollBackend.ll), bitwise operations such as and, or, and shl have been optimized or replaced with more efficient sequences.
  • Example: Replaced icmp samesign ult with shl and and to achieve the same logical result but with fewer instructions.

2. Branch Condition Simplification

  • Several conditional branches (br) have been simplified by replacing complex comparisons with simpler ones.
  • Example: In b/bench/linux/optimized/open.ll, the condition icmp samesign ult i32 %3, 4096 was replaced with a shift operation followed by an and.

3. Loop Unrolling and Phi Node Adjustments

  • Loop unrolling has been applied in several places to reduce the number of iterations and improve performance.
  • Phi nodes have been adjusted to handle the new control flow resulting from loop unrolling.
  • Example: In b/bench/softposit-rs/optimized/oveg98n4r9tnk39.ll, phi nodes were updated to reflect changes in the loop structure.

4. Memory Access Optimization

  • Memory access patterns have been optimized to reduce the number of loads and stores.
  • Example: In b/bench/quickjs/optimized/libbf.ll, redundant memory accesses were removed, and the logic for zeroing out memory was streamlined.

5. Constant Folding and Simplification

  • Constant expressions have been folded into single constants where possible.
  • Example: In b/bench/wireshark/optimized/in_cksum.ll, the comparison icmp samesign ugt i32 %170, 65535 was replaced with a shift operation, reducing the number of instructions needed to compute the result.

High-Level Overview of Changes

The patch primarily focuses on optimizing bitwise operations, simplifying branch conditions, and improving memory access patterns across various benchmarks. These optimizations aim to reduce the instruction count, improve cache locality, and enhance overall performance. The changes are consistent with LLVM's goal of producing more efficient machine code by leveraging advanced transformations and simplifications.

model: qwen-plus-latest
CompletionUsage(completion_tokens=521, prompt_tokens=30287, total_tokens=30808, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Mar 19, 2025
@dtcxzyw dtcxzyw deleted the test-run13945778479 branch May 18, 2025 09:32
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.

1 participant