[llvm-commits] [llvm] r67357 - /llvm/trunk/lib/Analysis/LiveValues.cpp
Dan Gohman
gohman at apple.com
Thu Mar 19 18:28:21 PDT 2009
Author: djg
Date: Thu Mar 19 20:28:21 2009
New Revision: 67357
URL: http://llvm.org/viewvc/llvm-project?rev=67357&view=rev
Log:
The last use in a block that doesn't have successors
(return or unreachable) is a kill.
Modified:
llvm/trunk/lib/Analysis/LiveValues.cpp
Modified: llvm/trunk/lib/Analysis/LiveValues.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LiveValues.cpp?rev=67357&r1=67356&r2=67357&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LiveValues.cpp (original)
+++ llvm/trunk/lib/Analysis/LiveValues.cpp Thu Mar 19 20:28:21 2009
@@ -131,6 +131,11 @@
// 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())
More information about the llvm-commits
mailing list