aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-06-25 20:42:55 +0000
committerBill Wendling <isanbard@gmail.com>2010-06-25 20:42:55 +0000
commit39d258aa49717218628c158504996482bbbb0a5a (patch)
treee17d5184c1a4100800321cef871b3ad92d541ecd /lib/CodeGen
parent39afa908dea0fc57291a2d08497f8d1877597c54 (diff)
downloadexternal_llvm-39d258aa49717218628c158504996482bbbb0a5a.zip
external_llvm-39d258aa49717218628c158504996482bbbb0a5a.tar.gz
external_llvm-39d258aa49717218628c158504996482bbbb0a5a.tar.bz2
We should remove the live range from the destination register only if *all* defs
are dead, not just the def of this register. I.e., a register could be dead, but it's subreg isn't. Testcase to follow with a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SimpleRegisterCoalescing.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 6209671..5a30ddf 100644
--- a/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -1892,8 +1892,8 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
if (li_->hasInterval(SrcReg)) {
LiveInterval &RegInt = li_->getInterval(SrcReg);
// If def of this move instruction is dead, remove its live range
- // from the dstination register's live interval.
- if (MI->registerDefIsDead(DstReg)) {
+ // from the destination register's live interval.
+ if (MI->allDefsAreDead()) {
if (!ShortenDeadCopySrcLiveRange(RegInt, MI))
ShortenDeadCopyLiveRange(RegInt, MI);
} else {