aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2008-07-15 09:00:17 +0000
committerMatthijs Kooijman <matthijs@stdin.nl>2008-07-15 09:00:17 +0000
commit30156524734c5a4ac49a1e8c607c375346770fa5 (patch)
tree5c7b74d4b290610c4ae7ef6173aac55cb5492d15
parent6cdd54b6f73b1e8a00f9879a3f7eb5f20c9d4830 (diff)
Split DAE::MarkLive into MarkLive and PropagateLiveness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53600 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp
index d2a5f28cb7..11c083b393 100644
--- a/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -134,6 +134,7 @@ namespace {
const UseVector &MaybeLiveUses);
void MarkLive(const RetOrArg &RA);
void MarkLive(const Function &F);
+ void PropagateLiveness(const RetOrArg &RA);
bool RemoveDeadStuffFromFunction(Function *F);
bool DeleteDeadVarargs(Function &Fn);
};
@@ -545,7 +546,12 @@ void DAE::MarkLive(const RetOrArg &RA) {
return; // We were already marked Live.
DOUT << "DAE - Marking " << RA.getDescription() << " live\n";
+ PropagateLiveness(RA);
+}
+/// PropagateLiveness - Given that RA is a live value, propagate it's liveness
+/// to any other values it uses (according to Uses).
+void DAE::PropagateLiveness(const RetOrArg &RA) {
// We don't use upper_bound (or equal_range) here, because our recursive call
// to ourselves is likely to cause the upper_bound (which is the first value
// not belonging to RA) to become erased and the iterator invalidated.