summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterScavenging.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-11-15 18:13:20 +0000
committerChad Rosier <mcrosier@apple.com>2012-11-15 18:13:20 +0000
commit2463f67c4975adc4225abe276a373a33a036add7 (patch)
tree20666d13ad465a5c30d8e96ed912f79870dfefc6 /llvm/lib/CodeGen/RegisterScavenging.cpp
parentfbea0f64e2b47e8f08dbb836b94caaefc3cdec66 (diff)
downloadbcm5719-llvm-2463f67c4975adc4225abe276a373a33a036add7.tar.gz
bcm5719-llvm-2463f67c4975adc4225abe276a373a33a036add7.zip
[reg scavenger] Fix the isUsed/isAliasUsed functions so as to not report a false
positive. In this particular case, R6 was being spilled by the register scavenger when it was in fact dead. The isUsed function reported R6 as used because the R6_R7 alias was reserved (due to the fact that we've reserved R7 as the FP). The solution is to only check if the original register (i.e., R6) isReserved and not the aliases. The aliases are only checked to make sure they're available. The test case is derived from one of the nightly tester benchmarks and is rather intractable and difficult to reproduce, so I haven't included it. rdar://12592448 llvm-svn: 168054
Diffstat (limited to 'llvm/lib/CodeGen/RegisterScavenging.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterScavenging.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp
index 5ec6564ce39..22d3c6217fd 100644
--- a/llvm/lib/CodeGen/RegisterScavenging.cpp
+++ b/llvm/lib/CodeGen/RegisterScavenging.cpp
@@ -43,7 +43,7 @@ void RegScavenger::setUsed(unsigned Reg) {
bool RegScavenger::isAliasUsed(unsigned Reg) const {
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI)
- if (isUsed(*AI))
+ if (isUsed(*AI, *AI == Reg))
return true;
return false;
}
OpenPOWER on IntegriCloud