Skip to content

pre-commit: PR134086 #2281

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: PR134086 #2281

wants to merge 3 commits into from

Conversation

dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Apr 18, 2025

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

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

dtcxzyw commented Apr 18, 2025

Diff mode

runner: ariselab-64c-v2
baseline: llvm/llvm-project@1db03ca
patch: llvm/llvm-project#134086
sha256: 723a585623db8c987ac6b93adf1369e4bdb80063df1519a224d290334d027ecd
commit: e0a191c

9 files changed, 3702 insertions(+), 3716 deletions(-)

Improvements:
  instsimplify.NumReassoc 344504 -> 405125 +17.60%
  globalsmodref-aa.NumNoMemFunctions 661806 -> 661809 +0.00%
  globalsmodref-aa.NumReadMemFunctions 1025542 -> 1025545 +0.00%
  instcombine.NumDeadInst 35305273 -> 35305313 +0.00%
  jump-threading.NumThreads 2370231 -> 2370232 +0.00%
  instcombine.NumCombined 105572768 -> 105572794 +0.00%
  licm.NumHoisted 4574360 -> 4574361 +0.00%
Regressions:
  reassociate.NumChanged 4252046 -> 4252044 -0.00%

23 22 bench/abc/optimized/dauGia.ll
9 10 bench/abseil-cpp/optimized/graphcycles.ll
12 14 bench/arrow/optimized/datum.ll
97 100 bench/llvm/optimized/ASTContext.ll
12 14 bench/ripgrep-rs/optimized/53g857orueoqngx4.ll

Copy link
Contributor

Summary of Changes

  1. Simplified Conditional Logic:

    • In the Gia_ManAppendMux2 function, a complex conditional check involving XOR and comparison (icmp eq i32 %19, 1) has been replaced with a simpler equality check (icmp eq i32 %3, %1). This reduces the number of instructions and simplifies the control flow.
  2. Optimized Phi Nodes:

    • Several phi nodes have been updated to remove redundant predecessors or merge equivalent values. For example, in Gia_ManAppendAnd2.exit.thread, the phi node for %.0.i23 now has fewer predecessors, improving clarity and reducing redundancy.
  3. Replaced Complex Operations with Intrinsic Calls:

    • The introduction of the llvm.umax.i16 intrinsic in ASTContext.ll replaces a sequence of operations (e.g., zext, add, and select) with a single call. This improves both readability and potential runtime performance.
  4. Streamlined Control Flow:

    • In multiple files (e.g., datum.ll and ASTContext.ll), branches and phi nodes have been restructured to eliminate unnecessary labels and simplify the flow of execution. For instance, in ASTContext.ll, the removal of intermediate blocks like %151 and %152 reduces complexity.
  5. Improved Alias Analysis:

    • The ripgrep-rs benchmark shows improvements in alias analysis annotations (!alias.scope, !noalias). These changes enhance the compiler's ability to optimize memory accesses by providing more precise information about pointer relationships.

High-Level Overview

The patch focuses on simplifying control flow, reducing redundancy in phi nodes, and leveraging intrinsic functions to replace complex sequences of operations. These changes collectively improve the readability and maintainability of the LLVM IR while potentially enhancing runtime performance through better optimization opportunities. Additionally, enhancements in alias analysis annotations contribute to more effective memory optimizations.

model: qwen-plus-latest
CompletionUsage(completion_tokens=413, prompt_tokens=20964, total_tokens=21377, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Apr 18, 2025
@dtcxzyw dtcxzyw deleted the test-run14533063294 branch May 18, 2025 09:31
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