-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[TTI][RISCV] Unconditionally break critical edges to sink ADDI #108889
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
Changes from 1 commit
3f4f26e
4c878bb
aeec393
4a89449
5fa0835
0617aac
b06c457
bc21dfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,22 +61,22 @@ define signext i32 @select_const_int_pow2_zero(i1 zeroext %a) nounwind { | |
| define signext i32 @select_const_int_harder(i1 zeroext %a) nounwind { | ||
| ; RV32-LABEL: select_const_int_harder: | ||
| ; RV32: # %bb.0: | ||
| ; RV32-NEXT: mv a1, a0 | ||
| ; RV32-NEXT: li a0, 6 | ||
| ; RV32-NEXT: bnez a1, .LBB3_2 | ||
| ; RV32-NEXT: bnez a0, .LBB3_2 | ||
| ; RV32-NEXT: # %bb.1: | ||
| ; RV32-NEXT: li a0, 38 | ||
| ; RV32-NEXT: ret | ||
| ; RV32-NEXT: .LBB3_2: | ||
| ; RV32-NEXT: li a0, 6 | ||
| ; RV32-NEXT: ret | ||
| ; | ||
| ; RV64-LABEL: select_const_int_harder: | ||
| ; RV64: # %bb.0: | ||
| ; RV64-NEXT: mv a1, a0 | ||
| ; RV64-NEXT: li a0, 6 | ||
| ; RV64-NEXT: bnez a1, .LBB3_2 | ||
| ; RV64-NEXT: bnez a0, .LBB3_2 | ||
| ; RV64-NEXT: # %bb.1: | ||
| ; RV64-NEXT: li a0, 38 | ||
| ; RV64-NEXT: ret | ||
| ; RV64-NEXT: .LBB3_2: | ||
| ; RV64-NEXT: li a0, 6 | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These select lowering changes are arguably real regressions. We are loosing the opportunity to allocate the untaken result into a register and then conditionally overwrite it. The tail duplication probably wouldn't happen in real code, so we'd end up emitting an extra unconditional jump to bypass the critical edge we split before the join. Specifically for these selects in tests, most can be done via arithmetic expansions instead. I started to implement that, but ended up pulling on a few too many intertwined changes. I do plan to go back to this, but I don't consider the select impact blocking here. |
||
| ; RV64-NEXT: ret | ||
| %1 = select i1 %a, i32 6, i32 38 | ||
| ret i32 %1 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.