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

Commit 429bfc9

Browse files
sbaranga-armswiftix
authored andcommitted
[RegisterScavenger] Remove aliasing registers of operands from the candidate set
Summary: In addition to not including the register operand of the current instruction also don't include any aliasing registers. We can't consider these as candidates because using them will clobber the corresponding register operand of the current instruction. This change doesn't include a test case and it would probably be difficult to produce a stable one since the bug depends on the results of register allocation. Reviewers: MatzeB, qcolombet, hfinkel Subscribers: hfinkel, llvm-commits Differential Revision: https://reviews.llvm.org/D24130 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280698 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 6fc0393 commit 429bfc9

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)