[AArch64] Fix clobber computation in A57LoadBalancing pass.

Extremely difficult to reproduce, so no test case included.
PR21637

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222677 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chad Rosier 2014-11-24 18:57:58 +00:00
parent 5a6b6744c0
commit 6b3c567613

View File

@ -481,10 +481,16 @@ int AArch64A57FPLoadBalancing::scavengeRegister(Chain *G, Color C,
RS.forward(I);
AvailableRegs &= RS.getRegsAvailable(TRI->getRegClass(RegClassID));
// Remove any registers clobbered by a regmask.
// Remove any registers clobbered by a regmask or any def register that is
// immediately dead.
for (auto J : I->operands()) {
if (J.isRegMask())
AvailableRegs.clearBitsNotInMask(J.getRegMask());
if (J.isReg() && J.isDef() && AvailableRegs[J.getReg()]) {
assert(J.isDead() && "Non-dead def should have been removed by now!");
AvailableRegs.reset(J.getReg());
}
}
}