[PeepholeOptimizer] Update the kill flags when extending the live-range of the

source of a copy.

<rdar://problem/12702965>

llvm-svn: 216229
This commit is contained in:
Quentin Colombet 2014-08-21 21:34:06 +00:00
parent c8dc50fa51
commit 6b36337c09
1 changed files with 5 additions and 1 deletions

View File

@ -899,7 +899,11 @@ bool PeepholeOptimizer::optimizeCoalescableCopy(MachineInstr *MI) {
if (!findNextSource(NewSrc, NewSubReg) || SrcReg == NewSrc)
continue;
// Rewrite source.
Changed |= CpyRewriter->RewriteCurrentSource(NewSrc, NewSubReg);
if (CpyRewriter->RewriteCurrentSource(NewSrc, NewSubReg)) {
// We may have extended the live-range of NewSrc, account for that.
MRI->clearKillFlags(NewSrc);
Changed = true;
}
}
// TODO: We could have a clean-up method to tidy the instruction.
// E.g., v0 = INSERT_SUBREG v1, v1.sub0, sub0