summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LiveValues.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-20 01:28:21 +0000
committerDan Gohman <gohman@apple.com>2009-03-20 01:28:21 +0000
commit76402b9a3da351a54b33431db275ac5c54874fb2 (patch)
treec0fff709cc0b6aa68b905a5eb9b0b359af4efd25 /llvm/lib/Analysis/LiveValues.cpp
parent03e0a4f324d983d228c4a257a5865f1db8ca89c9 (diff)
downloadbcm5719-llvm-76402b9a3da351a54b33431db275ac5c54874fb2.tar.gz
bcm5719-llvm-76402b9a3da351a54b33431db275ac5c54874fb2.zip
The last use in a block that doesn't have successors
(return or unreachable) is a kill. llvm-svn: 67357
Diffstat (limited to 'llvm/lib/Analysis/LiveValues.cpp')
-rw-r--r--llvm/lib/Analysis/LiveValues.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LiveValues.cpp b/llvm/lib/Analysis/LiveValues.cpp
index 2634463df20..21ddf6bc363 100644
--- a/llvm/lib/Analysis/LiveValues.cpp
+++ b/llvm/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())
OpenPOWER on IntegriCloud