aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/LiveValues.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/LiveValues.cpp b/lib/Analysis/LiveValues.cpp
index 2634463..21ddf6b 100644
--- a/lib/Analysis/LiveValues.cpp
+++ b/lib/Analysis/LiveValues.cpp
@@ -131,6 +131,11 @@ LiveValues::Memo &LiveValues::compute(const Value *V) {
// Note the block in which this use occurs.
M.Used.insert(UseBB);
+ // If the use block doesn't have successors, the value can be
+ // considered killed.
+ if (succ_begin(UseBB) == succ_end(UseBB))
+ M.Killed.insert(UseBB);
+
// Observe whether the value is used outside of the loop in which
// it is defined. Switch to an enclosing loop if necessary.
for (; L; L = L->getParentLoop())