Skip to content

Commit ba0e066

Browse files
author
Chad Rosier
committed
[AArch64] Fix clobber computation in A57LoadBalancing pass.
Extremely difficult to reproduce, so no test case included. PR21637 llvm-svn: 222677
1 parent 287c4e1 commit ba0e066

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,16 @@ int AArch64A57FPLoadBalancing::scavengeRegister(Chain *G, Color C,
481481
RS.forward(I);
482482
AvailableRegs &= RS.getRegsAvailable(TRI->getRegClass(RegClassID));
483483

484-
// Remove any registers clobbered by a regmask.
484+
// Remove any registers clobbered by a regmask or any def register that is
485+
// immediately dead.
485486
for (auto J : I->operands()) {
486487
if (J.isRegMask())
487488
AvailableRegs.clearBitsNotInMask(J.getRegMask());
489+
490+
if (J.isReg() && J.isDef() && AvailableRegs[J.getReg()]) {
491+
assert(J.isDead() && "Non-dead def should have been removed by now!");
492+
AvailableRegs.reset(J.getReg());
493+
}
488494
}
489495
}
490496

0 commit comments

Comments
 (0)