@@ -1154,10 +1154,9 @@ bool AArch64RegisterInfo::getRegAllocationHints(
11541154
11551155 // For predicated SVE instructions where the inactive lanes are undef,
11561156 // pick a destination register that is not unique to avoid introducing
1157- // a movprfx to copy a unique register to the destination operand .
1157+ // a movprfx.
11581158 const TargetRegisterClass *RegRC = MRI.getRegClass (VirtReg);
1159- if (ST.isSVEorStreamingSVEAvailable () &&
1160- AArch64::ZPRRegClass.hasSubClassEq (RegRC)) {
1159+ if (AArch64::ZPRRegClass.hasSubClassEq (RegRC)) {
11611160 for (const MachineOperand &DefOp : MRI.def_operands (VirtReg)) {
11621161 const MachineInstr &Def = *DefOp.getParent ();
11631162 if (DefOp.isImplicit () ||
@@ -1167,6 +1166,9 @@ bool AArch64RegisterInfo::getRegAllocationHints(
11671166
11681167 for (MCPhysReg R : Order) {
11691168 auto AddHintIfSuitable = [&](MCPhysReg R, const MachineOperand &MO) {
1169+ // R is a suitable register hint if there exists an operand for the
1170+ // instruction that is not yet allocated a register or if R matches
1171+ // one of the other source operands.
11701172 if (!VRM->hasPhys (MO.getReg ()) || VRM->getPhys (MO.getReg ()) == R)
11711173 Hints.push_back (R);
11721174 };
@@ -1187,8 +1189,6 @@ bool AArch64RegisterInfo::getRegAllocationHints(
11871189 break ;
11881190 case AArch64::DestructiveBinary:
11891191 case AArch64::DestructiveBinaryImm:
1190- case AArch64::DestructiveUnaryPassthru:
1191- case AArch64::Destructive2xRegImmUnpred:
11921192 AddHintIfSuitable (R, Def.getOperand (2 ));
11931193 break ;
11941194 }
0 commit comments