[llvm] r222677 - [AArch64] Fix clobber computation in A57LoadBalancing pass.
Chad Rosier
mcrosier at codeaurora.org
Mon Nov 24 10:57:58 PST 2014
Author: mcrosier
Date: Mon Nov 24 12:57:58 2014
New Revision: 222677
URL: http://llvm.org/viewvc/llvm-project?rev=222677&view=rev
Log:
[AArch64] Fix clobber computation in A57LoadBalancing pass.
Extremely difficult to reproduce, so no test case included.
PR21637
Modified:
llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp?rev=222677&r1=222676&r2=222677&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp Mon Nov 24 12:57:58 2014
@@ -481,10 +481,16 @@ int AArch64A57FPLoadBalancing::scavengeR
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());
+ }
}
}
More information about the llvm-commits
mailing list