diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-02-08 07:48:37 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-08 07:48:37 +0000 |
commit | 77fde2cbb1fbf9daf5235fa734c6c09b2d530617 (patch) | |
tree | 8270f14559be966445f51c716ca4895764843a78 /lib | |
parent | da01af76670f4e7296923bcf9382465875ef9b0a (diff) | |
download | external_llvm-77fde2cbb1fbf9daf5235fa734c6c09b2d530617.zip external_llvm-77fde2cbb1fbf9daf5235fa734c6c09b2d530617.tar.gz external_llvm-77fde2cbb1fbf9daf5235fa734c6c09b2d530617.tar.bz2 |
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index f09eee6..75389a4 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -42,6 +42,7 @@ STATISTIC(numExtends , "Number of copies extended"); STATISTIC(NumReMats , "Number of instructions re-materialized"); STATISTIC(numPeep , "Number of identity moves eliminated after coalescing"); STATISTIC(numAborts , "Number of times interval joining aborted"); +STATISTIC(numDeadValNo, "Number of valno def marked dead"); char SimpleRegisterCoalescing::ID = 0; static cl::opt<bool> @@ -863,9 +864,15 @@ SimpleRegisterCoalescing::ShortenDeadCopySrcLiveRange(LiveInterval &li, if (TrimLiveIntervalToLastUse(CopyIdx, CopyMI->getParent(), li, LR)) return false; - if (LR->valno->def == RemoveStart) - // If the def MI defines the val#, propagate the dead marker. - PropagateDeadness(li, CopyMI, RemoveStart, li_, tri_); + 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)) { + PropagateDeadness(li, CopyMI, RemoveStart, li_, tri_); + ++numDeadValNo; + } else + li.removeKill(LR->valno, RemoveEnd); + } removeRange(li, RemoveStart, LR->end, li_, tri_); return removeIntervalIfEmpty(li, li_, tri_); |