Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

pre-commit: PR173022 - #3538

Closed
zyw-bot wants to merge 1 commit into
mainfrom
test-run22716155434
Closed

pre-commit: PR173022#3538
zyw-bot wants to merge 1 commit into
mainfrom
test-run22716155434

Conversation

@zyw-bot

@zyw-bot zyw-bot commented Mar 5, 2026

Copy link
Copy Markdown
Collaborator

Link: /comptime llvm/llvm-project#173022
Requested by: @Camsyn

@github-actions github-actions Bot mentioned this pull request Mar 5, 2026
@zyw-bot

zyw-bot commented Mar 5, 2026

Copy link
Copy Markdown
Collaborator Author

Comptime mode

runner: ariselab-64c-docker
baseline: llvm/llvm-project@72e68fa
patch: llvm/llvm-project#173022
sha256: 839a9fc3d17e4961ed55c6affa60592a025a442123cd3f223f07a085cba85730

Compilation time result (by files):
Top 5 improvements:
  cvc5/cvc5_proof_rule.ll 464329964 -> 189828704 -59.12%
  cvc5/inference_id.ll 226968059 -> 107399037 -52.68%
  llvm/X86EncodingOptimization.ll 564778939 -> 310062364 -45.10%
  cvc5/kind.ll 277854259 -> 158594403 -42.92%
  libquic/net_errors.ll 195870457 -> 121686178 -37.87%
Top 5 regressions:
  faiss/IndexHNSW.ll 2159625016 -> 2282705818 +5.70%
  libquic/ssl_cipher.ll 652927031 -> 674801225 +3.35%
  lightgbm/gbdt.ll 4708119015 -> 4858683209 +3.20%
  gromacs/pme_redistribute.ll 806895427 -> 829380958 +2.79%
  gromacs/gmx_hbond.ll 4504015554 -> 4624124096 +2.67%

Overall: -0.01586058%
Compilation time result (by projects):
Top 5 improvements:
  tls-rs 38757120948 -> 38261505286 -1.28%
  ruff-rs 1024779581634 -> 1013104712449 -1.14%
  nghttp2 5977906805 -> 5945514067 -0.54%
  anki-rs 558618335 -> 556353197 -0.41%
  glslang 106091050980 -> 105668465322 -0.40%
Top 5 regressions:
  sentencepiece 125086137065 -> 125652326975 +0.45%
  pyo3-rs 9055227491 -> 9068071812 +0.14%
  soc-simulator 12184401000 -> 12200356050 +0.13%

Overall: -0.00071190%

@Camsyn

Camsyn commented Mar 5, 2026

Copy link
Copy Markdown

/close

@github-actions github-actions Bot closed this Mar 5, 2026
@dtcxzyw
dtcxzyw deleted the test-run22716155434 branch March 5, 2026 16:59
Camsyn added a commit to llvm/llvm-project that referenced this pull request Mar 12, 2026
When >1 predecessors of BB are identical, try to merge them into ONE.


---

Here is a simplified example (`sink` and `bb*`s share the same
predecessor `entry`, hindering the existing uncond br folding to
optimize such a case):
```diff
- entry:
-   switch to %br1, %br2, %br3, %sink
- bb1:
-   br label %sink
- bb2:
-   br label %sink
- bb3:
-   br label %sink
- sink:
-   %ret = phi i8 [ 0, %bb1 ], [ 0, %bb2 ], [ 0, %bb3 ], [ -1, %entry ]
+ entry:
+   switch to %br1, %sink
+ bb1:
+   br label %sink
+ sink:
+   %ret = phi i8 [ 0, %bb1 ], [ -1, %entry ]
```

Actually, `simplifyDuplicateSwitchArms` did similar things in a very
limited scope (only for switch arms), this patch generalizes its logic
to handle any BB with >1 identical predecessors.

---


This PR lands the
[discussion](dtcxzyw/llvm-opt-benchmark#3033 (comment)),
i.e., "merge identical predecessor bottom to up", and implements the
suggestion of
#114262 (comment).

- IR diff: dtcxzyw/llvm-opt-benchmark#3537
- CompTime Impact:
dtcxzyw/llvm-opt-benchmark#3538
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 12, 2026
When >1 predecessors of BB are identical, try to merge them into ONE.

---

Here is a simplified example (`sink` and `bb*`s share the same
predecessor `entry`, hindering the existing uncond br folding to
optimize such a case):
```diff
- entry:
-   switch to %br1, %br2, %br3, %sink
- bb1:
-   br label %sink
- bb2:
-   br label %sink
- bb3:
-   br label %sink
- sink:
-   %ret = phi i8 [ 0, %bb1 ], [ 0, %bb2 ], [ 0, %bb3 ], [ -1, %entry ]
+ entry:
+   switch to %br1, %sink
+ bb1:
+   br label %sink
+ sink:
+   %ret = phi i8 [ 0, %bb1 ], [ -1, %entry ]
```

Actually, `simplifyDuplicateSwitchArms` did similar things in a very
limited scope (only for switch arms), this patch generalizes its logic
to handle any BB with >1 identical predecessors.

---

This PR lands the
[discussion](dtcxzyw/llvm-opt-benchmark#3033 (comment)),
i.e., "merge identical predecessor bottom to up", and implements the
suggestion of
llvm/llvm-project#114262 (comment).

- IR diff: dtcxzyw/llvm-opt-benchmark#3537
- CompTime Impact:
dtcxzyw/llvm-opt-benchmark#3538
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants