pre-commit: PR173022 - #3537
Conversation
Diff moderunner: ariselab-64c-docker 1380 files changed, 258558 insertions(+), 265955 deletions(-) +14 hwloc/lstopo-ascii.ll |
|
Here's a concise summary of the major changes in this LLVM IR diff:
These changes collectively indicate aggressive CFG cleanup, dead code elimination, and canonicalization—typical of late-stage optimizations like model: qwen-plus-latest |
|
No new regression was introduced compared with #3204.
|
|
/close |
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
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
Link: llvm/llvm-project#173022
Requested by: @Camsyn