Eliminate dead code after remat.

This will remove the original def once it has no more uses.

llvm-svn: 157104
This commit is contained in:
Jakob Stoklund Olesen 2012-05-19 05:25:59 +00:00
parent 719bee51d1
commit 7b47611be6

View File

@ -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;
}