-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AArch64][SME2] Extend getRegAllocationHints for ZPRStridedOrContiguousReg #119865
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 4 commits
8f466f8
53e6242
b49fa70
1ac1992
70b5317
52f2bd3
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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1098,6 +1098,43 @@ bool AArch64RegisterInfo::getRegAllocationHints( | |||||||||||||||
| SmallVectorImpl<MCPhysReg> &Hints, const MachineFunction &MF, | ||||||||||||||||
| const VirtRegMap *VRM, const LiveRegMatrix *Matrix) const { | ||||||||||||||||
| const MachineRegisterInfo &MRI = MF.getRegInfo(); | ||||||||||||||||
| unsigned RegID = MRI.getRegClass(VirtReg)->getID(); | ||||||||||||||||
|
|
||||||||||||||||
| // Since the SVE calling convention preserves registers Z8-Z23, there are no | ||||||||||||||||
| // ZPR2Strided or ZPR4Strided registers which do not overlap with the | ||||||||||||||||
| // callee-saved registers. These will be pushed to the back of the allocation | ||||||||||||||||
|
||||||||||||||||
| // Since the SVE calling convention preserves registers Z8-Z23, there are no | |
| // ZPR2Strided or ZPR4Strided registers which do not overlap with the | |
| // callee-saved registers. These will be pushed to the back of the allocation | |
| // The SVE calling convention preserves registers Z8-Z23. As a result, there are no | |
| // ZPR2Strided or ZPR4Strided registers that do not overlap with the | |
| // callee-saved registers and so by default these will be pushed to the back of the allocation |
Outdated
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.
nit:
| // However, if any of the instructions which define VirtReg are | |
| // ZPRStridedOrContiguous registers used by a FORM_TRANSPOSED_REG_TUPLE | |
| // pseudo, it will likely be better to try assigning a strided register | |
| // anyway to avoid extra copy instructions. | |
| // If any of the instructions which define VirtReg are | |
| // used by the FORM_TRANSPOSED_REG_TUPLE | |
| // pseudo, we actually want to favour reducing copy instructions over reducing the number of clobbered callee-save registers, so we add the registers as a hint. |
(+clang-format)
Outdated
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.
nit: remove empty newline at start of basic block (also below)
Outdated
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.
| if (any_of(MRI.use_nodbg_instructions(VirtReg), [](MachineInstr &Use) { | |
| if (any_of(MRI.use_nodbg_instructions(VirtReg), [](const MachineInstr &Use) { |
Outdated
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.
nit: if you want to use the nested if's, then maybe move this to the outer if-then block? alternatively, you could fold the if condition above with the if above it.
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.
I've folded the two nested if conditions at the beginning of this block
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.
nit: move below the comment.