summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit900f58441d556146bd773db5023c3565d519b165 (patch)
treeb390adc8faf62010e3cd27094be7f9270700abd5 /llvm/lib
parentdcffc626c0fb352dc40c8a1120b90dd51ecc4761 (diff)
downloadbcm5719-llvm-900f58441d556146bd773db5023c3565d519b165.tar.gz
bcm5719-llvm-900f58441d556146bd773db5023c3565d519b165.zip
Eliminate dead code after remat.
This will remove the original def once it has no more uses. llvm-svn: 157104
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index 3204eff9cbb..7126bdd1674 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud