Skip to content

pre-commit: PR127140 #2119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

pre-commit: PR127140 #2119

wants to merge 3 commits into from

Conversation

dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Feb 14, 2025

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

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

dtcxzyw commented Feb 14, 2025

runner: ariselab-64c-v2
baseline: llvm/llvm-project@29b7295
patch: llvm/llvm-project#127140
sha256: 2da51683c957378b5fe5b1feb13447c466dcab84723eb9dadc63004816739442
commit: 366cd51

10 files changed, 8904 insertions(+), 8911 deletions(-)

Improvements:
  correlated-value-propagation.NumSelects 214934 -> 214937 +0.00%
  early-cse.NumSimplify 25080316 -> 25080483 +0.00%
  simplifycfg.NumFoldValueComparisonIntoPredecessors 479567 -> 479568 +0.00%
  simplifycfg.NumHoistCommonInstrs 1771237 -> 1771240 +0.00%
  correlated-value-propagation.NumNonNull 6882514 -> 6882521 +0.00%
  instcombine.NumOneIteration 40121062 -> 40121064 +0.00%
  instcombine.NumWorklistIterations 57219139 -> 57219141 +0.00%
Regressions:
  instcombine.NumConstProp 123359 -> 123358 -0.00%
  correlated-value-propagation.NumPhis 995164 -> 995159 -0.00%
  early-cse.NumCSE 4051720 -> 4051706 -0.00%
  jump-threading.NumFolds 2086952 -> 2086947 -0.00%
  instcombine.NumCombined 99695124 -> 99694940 -0.00%
  simplifycfg.NumFoldBranchToCommonDest 580349 -> 580348 -0.00%
  instcombine.NumSunkInst 2729035 -> 2729033 -0.00%
  memdep.NumCacheCompleteNonLocalPtr 4333355 -> 4333352 -0.00%
  constraint-elimination.NumCondsRemoved 1734701 -> 1734700 -0.00%
  jump-threading.NumThreads 2235304 -> 2235303 -0.00%

1 1 bench/mini-lsm-rs/optimized/2y1m09w3fogtr6jd.ll
2 2 bench/mini-lsm-rs/optimized/haynj55bb7tm6r1.ll
1 2 bench/ockam-rs/optimized/1411u8drt798uxi8.ll
36 29 bench/php/optimized/zend_jit.ll
4 4 bench/rust-analyzer-rs/optimized/p80zqc6dxbxvppz.ll

Copy link
Contributor

Summary of Changes

This patch includes several modifications to LLVM IR files, focusing on optimizing and refining the generated code. Below are the key changes:

  1. Adjustment of random_height Function Range:

    • In multiple files (2y1m09w3fogtr6jd.ll, haynj55bb7tm6r1.ll), the range of the random_height function has been reduced from (i64 1, 65) to (i64 1, 4). This change likely reflects a more constrained or realistic height range for skip lists, potentially improving performance by reducing unnecessary computations.
  2. Removal of Unnecessary Instructions:

    • In 1411u8drt798uxi8.ll, a redundant select instruction (%. = select i1 %7, ptr null, ptr %5) was removed. This simplifies the control flow and reduces overhead by eliminating an unused branch.
  3. Optimization of Load and Comparison Logic:

    • In zend_jit.ll, the load instruction %20 = load i32, ptr %18, align 8 was replaced with a direct use of %19, which is already loaded earlier in the function. This avoids redundant memory accesses and improves cache utilization.
    • Additionally, several comparisons and assumptions (llvm.assume) were updated to use %19 instead of reloading values, further streamlining the logic.
  4. Refinement of Control Flow and Switch Cases:

    • The switch block in zend_jit.ll was expanded to include additional cases (i8 104, i8 98, i8 102). This ensures better handling of edge cases and improves the robustness of the generated code.
    • An unreachable label was added, indicating that certain paths are no longer valid, which helps in static analysis and optimization.
  5. Label Renaming and Branch Optimization:

    • In p80zqc6dxbxvppz.ll, several labels were renamed (e.g., .exit.i.exit.thread212.i) to reflect their purpose more clearly. This improves readability and maintainability.
    • Branching logic was adjusted to consolidate redundant paths, such as merging multiple predecessors into a single label (624).

High-Level Overview

The changes aim to improve the efficiency and clarity of the generated LLVM IR. Key optimizations include reducing redundant computations, refining control flow, and enhancing memory access patterns. These modifications are likely driven by improvements in the Rust compiler's backend or specific LLVM passes, focusing on performance and code quality. The adjustments also ensure better adherence to expected behavior, such as constraining random height ranges and handling edge cases explicitly. Overall, the patch contributes to generating more efficient and maintainable machine code.

model: qwen-plus-latest
CompletionUsage(completion_tokens=602, prompt_tokens=7936, total_tokens=8538, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Feb 14, 2025
@dtcxzyw dtcxzyw deleted the test-run13324740412 branch February 24, 2025 06:20
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