diff options
author | Dan Gohman <gohman@apple.com> | 2009-03-20 01:28:21 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-03-20 01:28:21 +0000 |
commit | 654c98c4f39591132027835a52dee4993618de51 (patch) | |
tree | 7be34d0475e87700480a88549c21014b58a8df9d /lib | |
parent | 23d8539d1e82c90a4f973eef5fd0dcbd9d16a500 (diff) | |
download | external_llvm-654c98c4f39591132027835a52dee4993618de51.zip external_llvm-654c98c4f39591132027835a52dee4993618de51.tar.gz external_llvm-654c98c4f39591132027835a52dee4993618de51.tar.bz2 |
The last use in a block that doesn't have successors
(return or unreachable) is a kill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/LiveValues.cpp | 5 |
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()) |