-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
[SME] Stop RA from coalescing COPY instructions that transcend beyond smstart/smstop. #78294
Changes from all commits
9aee635
29a0b5f
dfa8b49
a104ba0
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 |
---|---|---|
|
@@ -28,6 +28,8 @@ def AArch64_restore_zt : SDNode<"AArch64ISD::RESTORE_ZT", SDTypeProfile<0, 2, | |
def AArch64_save_zt : SDNode<"AArch64ISD::SAVE_ZT", SDTypeProfile<0, 2, | ||
[SDTCisInt<0>, SDTCisPtrTy<1>]>, | ||
[SDNPHasChain, SDNPSideEffect, SDNPMayStore]>; | ||
def AArch64CoalescerBarrier | ||
: SDNode<"AArch64ISD::COALESCER_BARRIER", SDTypeProfile<1, 1, []>, []>; | ||
|
||
//===----------------------------------------------------------------------===// | ||
// Instruction naming conventions. | ||
|
@@ -189,6 +191,26 @@ def : Pat<(int_aarch64_sme_set_tpidr2 i64:$val), | |
(MSR 0xde85, GPR64:$val)>; | ||
def : Pat<(i64 (int_aarch64_sme_get_tpidr2)), | ||
(MRS 0xde85)>; | ||
|
||
multiclass CoalescerBarrierPseudo<RegisterClass rc, list<ValueType> vts> { | ||
def NAME : Pseudo<(outs rc:$dst), (ins rc:$src), []>, Sched<[]> { | ||
let Constraints = "$dst = $src"; | ||
} | ||
foreach vt = vts in { | ||
def : Pat<(vt (AArch64CoalescerBarrier (vt rc:$src))), | ||
(!cast<Instruction>(NAME) rc:$src)>; | ||
} | ||
} | ||
|
||
multiclass CoalescerBarriers { | ||
defm _FPR16 : CoalescerBarrierPseudo<FPR16, [bf16, f16]>; | ||
defm _FPR32 : CoalescerBarrierPseudo<FPR32, [f32]>; | ||
defm _FPR64 : CoalescerBarrierPseudo<FPR64, [f64, v8i8, v4i16, v2i32, v1i64, v4f16, v2f32, v1f64, v4bf16]>; | ||
defm _FPR128 : CoalescerBarrierPseudo<FPR128, [f128, v16i8, v8i16, v4i32, v2i64, v8f16, v4f32, v2f64, v8bf16]>; | ||
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. Do we need to worry about v1i128 - or is that not even legal? 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. Adding v1i128 leads to TableGen issues that say |
||
} | ||
|
||
defm COALESCER_BARRIER : CoalescerBarriers; | ||
|
||
} // End let Predicates = [HasSME] | ||
|
||
// Pseudo to match to smstart/smstop. This expands: | ||
|
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.
Do we need to worry about unusual types such as v8i7? I assume these get promoted to v8i8 anyway, but I wasn't sure if we should perhaps have at least one test for them. Similarly, I wonder what happens with v8i1?
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.
As you say, we should only have legal types at this point. I've added a test for v8i1, but I'm not sure how to add a test for v8i7, as there will be no legalisation for
<vscale x 8 x i7>
.