From 86fb9fdb2000213d3cd5a082e8501cb8fe974a14 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 8 Feb 2009 08:24:28 +0000 Subject: Strengthen the previous check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64076 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SimpleRegisterCoalescing.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index a7d5d00..db7109e 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -489,7 +489,7 @@ static void removeRange(LiveInterval &li, unsigned Start, unsigned End, } /// TrimLiveIntervalToLastUse - If there is a last use in the same basic block -/// as the copy instruction, trim the ive interval to the last use and return +/// as the copy instruction, trim the live interval to the last use and return /// true. bool SimpleRegisterCoalescing::TrimLiveIntervalToLastUse(unsigned CopyIdx, @@ -867,9 +867,10 @@ SimpleRegisterCoalescing::ShortenDeadCopySrcLiveRange(LiveInterval &li, if (LR->valno->def == RemoveStart) { // If the def MI defines the val# and this copy is the only kill of the // val#, then propagate the dead marker. - if (!li.isOnlyKill(LR->valno, RemoveEnd)) - li.removeKill(LR->valno, RemoveEnd); - else { + if (!li.isOnlyLROfValNo(LR)) { + if (li.isKill(LR->valno, RemoveEnd)) + li.removeKill(LR->valno, RemoveEnd); + } else { PropagateDeadness(li, CopyMI, RemoveStart, li_, tri_); ++numDeadValNo; } -- cgit v1.1