summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2015-07-06 14:46:34 +0000
committerChad Rosier <mcrosier@codeaurora.org>2015-07-06 14:46:34 +0000
commit85a346395eccfa6a555e862ac7dee05d43adef3a (patch)
tree8808a530aab503344756fe6177fe4511725d44cd
parent6b067074f90cf238976acdbea5ee1617d83ff2cc (diff)
downloadbcm5719-llvm-85a346395eccfa6a555e862ac7dee05d43adef3a.tar.gz
bcm5719-llvm-85a346395eccfa6a555e862ac7dee05d43adef3a.zip
Fix a bug in the A57FPLoadBalancing register tracking/scavenger.
The code in AArch64A57FPLoadBalancing::scavengeRegister() to handle dead defs was not correctly handling aliased registers. E.g. if the dead def was of D2, then S2 was not being marked as unavailable, so it could potentially be used across a live-range in which it would be clobbered. Patch by Geoff Berry <gberry@codeaurora.org>! Phabricator: http://reviews.llvm.org/D10900 llvm-svn: 241449
-rw-r--r--llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp b/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
index bffd9e6e8c7..9d6dbd641a1 100644
--- a/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
+++ b/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
@@ -510,9 +510,17 @@ int AArch64A57FPLoadBalancing::scavengeRegister(Chain *G, Color C,
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());
+ if (J.isReg() && J.isDef()) {
+ MCRegAliasIterator AI(J.getReg(), TRI, /*IncludeSelf=*/true);
+ if (J.isDead())
+ for (; AI.isValid(); ++AI)
+ AvailableRegs.reset(*AI);
+#ifndef NDEBUG
+ else
+ for (; AI.isValid(); ++AI)
+ assert(!AvailableRegs[*AI] &&
+ "Non-dead def should have been removed by now!");
+#endif
}
}
}
OpenPOWER on IntegriCloud