Skip to content

Commit bb3ba81

Browse files
committed
Remove unbound register condition
1 parent da5f256 commit bb3ba81

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,17 +1173,12 @@ bool AArch64RegisterInfo::getRegAllocationHints(
11731173
for (MCPhysReg R : Order) {
11741174
auto AddHintIfSuitable = [&](MCPhysReg R,
11751175
const MachineOperand &MO) -> bool {
1176-
// R is a suitable register hint if:
1177-
// * R is one of the source operands.
1178-
// * The register allocator has not suggested any hints and one of the
1179-
// instruction's source operands does not yet have a register
1180-
// allocated for it.
1181-
if (VRM->getPhys(MO.getReg()) == R ||
1182-
(!VRM->hasPhys(MO.getReg()) && Hints.empty())) {
1183-
Hints.push_back(R);
1184-
return true;
1185-
}
1186-
return false;
1176+
// R is a suitable register hint if R can reuse one of the other
1177+
// source operands.
1178+
if (VRM->getPhys(MO.getReg()) != R)
1179+
return false;
1180+
Hints.push_back(R);
1181+
return true;
11871182
};
11881183

11891184
switch (InstFlags & AArch64::DestructiveInstTypeMask) {

0 commit comments

Comments
 (0)