Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit e85c04a

Browse files
committed
Merge remote-tracking branch 'origin/swift-3.1-branch' into stable
* origin/swift-3.1-branch: [RegisterScavenger] Remove aliasing registers of operands from the candidate set
2 parents b5a6088 + 429bfc9 commit e85c04a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/CodeGen/RegisterScavenging.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
419419
for (const MachineOperand &MO : MI.operands()) {
420420
if (MO.isReg() && MO.getReg() != 0 && !(MO.isUse() && MO.isUndef()) &&
421421
!TargetRegisterInfo::isVirtualRegister(MO.getReg()))
422-
Candidates.reset(MO.getReg());
422+
for (MCRegAliasIterator AI(MO.getReg(), TRI, true); AI.isValid(); ++AI)
423+
Candidates.reset(*AI);
423424
}
424425

425426
// Try to find a register that's unused if there is one, as then we won't

0 commit comments

Comments
 (0)