aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-19 05:25:59 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-19 05:25:59 +0000
commit1dc6d7cbb5affee14a2fc5e7269616f3b7b4b6fa (patch)
tree3cfe7f610e697a6e3d16ac55f9c3ce5e193606ec
parent67ccb29cec06c85210f334cfbdae144460170cd3 (diff)
Eliminate dead code after remat.
This will remove the original def once it has no more uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157104 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/RegisterCoalescer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp
index 3204eff9cb..7126bdd167 100644
--- a/lib/CodeGen/RegisterCoalescer.cpp
+++ b/lib/CodeGen/RegisterCoalescer.cpp
@@ -870,7 +870,9 @@ bool RegisterCoalescer::reMaterializeTrivialDef(LiveInterval &SrcInt,
++NumReMats;
// The source interval can become smaller because we removed a use.
- LIS->shrinkToUses(&SrcInt);
+ LIS->shrinkToUses(&SrcInt, &DeadDefs);
+ if (!DeadDefs.empty())
+ eliminateDeadDefs();
return true;
}