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

Quentin Colombet qcolombet at apple.com
Thu Aug 21 14:34:06 PDT 2014


Author: qcolombet
Date: Thu Aug 21 16:34:06 2014
New Revision: 216229

URL: http://llvm.org/viewvc/llvm-project?rev=216229&view=rev
Log:
[PeepholeOptimizer] Update the kill flags when extending the live-range of the
source of a copy.

<rdar://problem/12702965>

Modified:
    llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp

Modified: llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp?rev=216229&r1=216228&r2=216229&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp Thu Aug 21 16:34:06 2014
@@ -899,7 +899,11 @@ bool PeepholeOptimizer::optimizeCoalesca
     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





More information about the llvm-commits mailing list