RegisterCoalescer: Do not remove IMPLICIT_DEFS if they are required for subranges.

The register coalescer used to remove implicit_defs when they are
covered by the main range anyway. With subreg liveness tracking we can't
do that anymore in places where the IMPLICIT_DEF is required as begin of
a subregister liverange.

llvm-svn: 225416
This commit is contained in:
Matthias Braun 2015-01-08 00:21:23 +00:00
parent d55e6ddacf
commit 9d7bc0874c
1 changed files with 7 additions and 1 deletions

View File

@ -1912,8 +1912,14 @@ JoinVals::analyzeValue(unsigned ValNo, JoinVals &Other) {
return CR_Replace;
// Check for simple erasable conflicts.
if (DefMI->isImplicitDef())
if (DefMI->isImplicitDef()) {
// We need the def for the subregister if there is nothing else live at the
// subrange at this point.
if (TrackSubRegLiveness
&& (V.WriteLanes & (OtherV.ValidLanes | OtherV.WriteLanes)) == 0)
return CR_Replace;
return CR_Erase;
}
// Include the non-conflict where DefMI is a coalescable copy that kills
// OtherVNI. We still want the copy erased and value numbers merged.