-
Notifications
You must be signed in to change notification settings - Fork 9
pre-commit: PR173022 #3204
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
base: main
Are you sure you want to change the base?
pre-commit: PR173022 #3204
Conversation
Diff moderunner: ariselab-64c-docker 2704 files changed, 644161 insertions(+), 651408 deletions(-) +29 box2d/distance.ll |
|
Here's a concise summary of the major changes in the patch:
These changes collectively reflect aggressive IR-level optimizations—particularly CFG simplification, dead block elimination, alignment-aware codegen, and precise phi maintenance—across diverse codebases. model: qwen-plus-latest |
| i32 3, label %226 | ||
| i32 1, label %210 | ||
| i32 2, label %213 | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correlated-propagation is sensitive to the difference in PHI incoming value order, causing such regression.
original: LVI infered that %212 ∈ [4,3)
%212 = phi i32 [ 1, %b2SolveSimplex2.exit.thread.thread ], [ 2, %203 ], [ %202, %b2SolveSimplex2.exit ]- init: from pred
%b2SolveSimplex2.exit.thread.thread ],%212 ∈ [1, 2) - merge: from pred
%203,%212 ∈ [1, 3) = [1,2) ∪ [2, 3) - merge: from pred
%b2SolveSimplex2.exit,%212 ∈ [4, 3) = [1, 3) ∪ [4, 1)%b2SolveSimplex2.exitis switch default with arms1, 2, 3, thus we can infer that%202 ∈ [4, 1)
- finally:
%212 ∈ [4, 3), i.e.,%212 != 3
new: : LVI infered that %212 = overdefined
%212 = phi i32 [ 2, %203 ], [ %202, %b2SolveSimplex2.exit ], [ 1, %b2SolveSimplex2.exit.thread.thread ]- init: from pred
%b2SolveSimplex2.exit.thread.thread ],%212 ∈ [2, 3) - merge: from pred
%b2SolveSimplex2.exit,%212 ∈ [2,1) = [2, 3) ∪ [4, 1)%b2SolveSimplex2.exitis switch default with arms1, 2, 3, thus we can infer that%202 ∈ [4, 1)
- merge: from pred
%203,%212 = overdefined = [2,1) ∪ [1,2) - finally:
%212 = overdefined
| switch.edge80.i: ; preds = %30 | ||
| br label %.thread93.i | ||
|
|
||
| .fold.split77.i: ; preds = %30 | ||
| br label %.thread93.i | ||
|
|
||
| .fold.split78.i: ; preds = %30 | ||
| br label %.thread93.i | ||
|
|
||
| .fold.split79.i: ; preds = %30 | ||
| br label %.thread93.i | ||
|
|
||
| .fold.split81.i: ; preds = %30, %30, %30, %30 | ||
| br label %.thread93.i | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These arms should have been folded into a switch table lookup by `simplifycfg.
| %41 = and i32 %4, 3 | ||
| %42 = xor i32 %41, 3 | ||
| %43 = or i32 %42, %3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are speculative insns, which could not be sunk by simplifycfg<sink-common-insts>
Link: llvm/llvm-project#173022
Requested by: @Camsyn