@@ -1099,14 +1099,14 @@ bool AArch64RegisterInfo::getRegAllocationHints(
10991099 const VirtRegMap *VRM, const LiveRegMatrix *Matrix) const {
11001100 const MachineRegisterInfo &MRI = MF.getRegInfo ();
11011101
1102- // Since the SVE calling convention preserves registers Z8-Z23, there are no
1103- // ZPR2Strided or ZPR4Strided registers which do not overlap with the
1104- // callee-saved registers. These will be pushed to the back of the allocation
1105- // order for the ZPRStridedOrContiguous classes.
1106- // However, if any of the instructions which define VirtReg are
1107- // ZPRStridedOrContiguous registers used by a FORM_TRANSPOSED_REG_TUPLE
1108- // pseudo, it will likely be better to try assigning a strided register
1109- // anyway to avoid extra copy instructions .
1102+ // The SVE calling convention preserves registers Z8-Z23. As a result, there
1103+ // are no ZPR2Strided or ZPR4Strided registers that do not overlap with the
1104+ // callee-saved registers and so by default these will be pushed to the back
1105+ // of the allocation order for the ZPRStridedOrContiguous classes.
1106+ // If any of the instructions which define VirtReg are used by the
1107+ // FORM_TRANSPOSED_REG_TUPLE pseudo, we want to favour reducing copy
1108+ // instructions over reducing the number of clobbered callee-save registers,
1109+ // so we add the strided registers as a hint .
11101110 unsigned RegID = MRI.getRegClass (VirtReg)->getID ();
11111111 // Look through uses of the register for FORM_TRANSPOSED_REG_TUPLE.
11121112 if ((RegID == AArch64::ZPR2StridedOrContiguousRegClassID ||
@@ -1116,8 +1116,6 @@ bool AArch64RegisterInfo::getRegAllocationHints(
11161116 AArch64::FORM_TRANSPOSED_REG_TUPLE_X2_PSEUDO ||
11171117 Use.getOpcode () == AArch64::FORM_TRANSPOSED_REG_TUPLE_X4_PSEUDO;
11181118 })) {
1119- // Push the list of 2/4 ZPRStrided registers to Hints to ensure we try to
1120- // allocate these first.
11211119 const TargetRegisterClass *StridedRC =
11221120 RegID == AArch64::ZPR2StridedOrContiguousRegClassID
11231121 ? &AArch64::ZPR2StridedRegClass
0 commit comments