Skip to content
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

pre-commit: PR127437 #2125

Closed
wants to merge 3 commits into from
Closed

pre-commit: PR127437 #2125

wants to merge 3 commits into from

Conversation

dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Feb 17, 2025

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

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

dtcxzyw commented Feb 17, 2025

runner: ariselab-64c-v2
baseline: llvm/llvm-project@9b7282e
patch: llvm/llvm-project#127437
sha256: a9e919a2ebd4fa41a8c5f118fae6bac78681cfd4ae90cfb476d6ea9477df3662
commit: cd503ee

113 files changed, 2336 insertions(+), 2343 deletions(-)

Improvements:
  sccp.NumInstReplaced 145405 -> 145407 +0.00%
  loop-delete.NumDeleted 144882 -> 144883 +0.00%
  gvn.NumGVNBlocks 210935 -> 210936 +0.00%
  gvn.NumGVNEqProp 341011 -> 341012 +0.00%
  globalsmodref-aa.NumNoMemFunctions 674672 -> 674673 +0.00%
  globalsmodref-aa.NumReadMemFunctions 1037065 -> 1037066 +0.00%
  instcombine.NegatorTotalNegationsAttempted 17930996 -> 17931013 +0.00%
  instcombine.NegatorNumValuesVisited 18680611 -> 18680628 +0.00%
  last-run-tracking.NumSkippedPasses 45999922 -> 45999951 +0.00%
  scalar-evolution.NumExitCountsComputed 3673049 -> 3673050 +0.00%
Regressions:
  correlated-value-propagation.NumAddNUW 180386 -> 180200 -0.10%
  correlated-value-propagation.NumNUW 376540 -> 376354 -0.05%
  correlated-value-propagation.NumAddNW 394514 -> 394324 -0.05%
  correlated-value-propagation.NumNW 818105 -> 817915 -0.02%
  correlated-value-propagation.NumAddNSW 214128 -> 214124 -0.00%
  instcombine.NumCombined 99695210 -> 99694190 -0.00%
  correlated-value-propagation.NumNSW 442187 -> 442183 -0.00%
  lcssa.NumLCSSA 13636577 -> 13636564 -0.00%
  instsimplify.NumSimplified 2147637 -> 2147635 -0.00%
  memdep.NumCacheNonLocalPtr 190473761 -> 190473625 -0.00%

1 1 bench/abc/optimized/abcUtil.ll
16 16 bench/abseil-cpp/optimized/container_test.ll
6 6 bench/freetype/optimized/autofit.ll
9 9 bench/gromacs/optimized/evaluate.ll
4 4 bench/gromacs/optimized/gmx_xpm2ps.ll
3 3 bench/gromacs/optimized/trajectory.ll
27 34 bench/hdf5/optimized/H5FDmulti.ll
2 2 bench/jq/optimized/regcomp.ll
3 3 bench/meshlab/optimized/filter_measure.ll
2 2 bench/mold/optimized/output-chunks.cc.ALPHA.ll
12 12 bench/opencv/optimized/freak.ll
13 13 bench/redis/optimized/cluster_legacy.ll
5 5 bench/redis/optimized/t_zset.ll

Copy link
Contributor

This LLVM IR diff introduces several optimizations and changes across multiple benchmarks. Below is a summary of the major changes observed:

  1. Addition Instructions with NUW/NSW Flags:

    • Many add instructions now include the nuw (No Unsigned Wrap) and nsw (No Signed Wrap) flags. This indicates that the compiler has determined these additions will not overflow, allowing for more aggressive optimizations and potentially enabling better vectorization or constant propagation.
    • Examples include:
      • %spec.select = add nuw nsw i32 %62, %.0144 in abcUtil.ll.
      • %spec.select.i.i.i.i = add nuw nsw i64 %2, %__parent.011.i.i.i.i in container_test.ll.
  2. GetElementPtr Instructions with NUW:

    • Several getelementptr instructions now include the nuw flag, indicating that the pointer arithmetic involved will not wrap around. This helps the optimizer to make stronger assumptions about memory access patterns.
    • Example: %add.ptr.i.i.i.i.i46 = getelementptr inbounds nuw i32, ptr %14, i64 %__parent.011.i.i.i.i44 in container_test.ll.
  3. Comparison Changes:

    • Some comparisons have been replaced with stricter conditions. For example, icmp sgt (signed greater than) has been replaced with icmp ne (not equal), which simplifies the condition and avoids signedness concerns.
    • Example: %12 = icmp eq i64 %spec.select.i.i, 0 in trajectory.ll.
  4. Integer Conversion Changes:

    • Some integer conversions have been updated from sext (sign extension) to zext (zero extension). This change is typically made when the compiler determines that the value being converted is non-negative, allowing for more efficient code generation.
    • Example: %conv149 = zext nneg i32 %add148 to i64 in t_zset.ll.
  5. Branch Condition Simplifications:

    • In some cases, branch conditions have been simplified or restructured to improve clarity and performance. For instance, redundant branches or conditions have been removed or combined.
    • Example: The restructuring of the if.end38.thread block in cluster_legacy.ll to use a single or operation for branching.

High-Level Overview:

The changes primarily focus on improving the safety and efficiency of arithmetic operations by adding NUW/NSW flags, refining pointer arithmetic with NUW, and simplifying comparison and conversion logic. These modifications enable the LLVM optimizer to make stronger assumptions about the program's behavior, potentially leading to better performance through improved instruction scheduling, reduced register pressure, and enhanced vectorization opportunities. Additionally, the simplification of branch conditions can lead to more predictable control flow, further enhancing execution speed.

model: qwen-plus-latest
CompletionUsage(completion_tokens=627, prompt_tokens=19125, total_tokens=19752, completion_tokens_details=None, prompt_tokens_details=None)

@dtcxzyw dtcxzyw closed this Feb 17, 2025
@dtcxzyw dtcxzyw deleted the test-run13363554626 branch February 24, 2025 06: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.

1 participant