summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2014-08-21 21:34:06 +0000
committerQuentin Colombet <qcolombet@apple.com>2014-08-21 21:34:06 +0000
commit6b36337c0913fc5fdb4e73678d63248bd89ff5f0 (patch)
tree25ff3ca02acdc7de130fc753096a49d743a5f5a5 /llvm/lib
parentc8dc50fa515b5747b8ff1f1a20bdd2cb22d1ca1f (diff)
downloadbcm5719-llvm-6b36337c0913fc5fdb4e73678d63248bd89ff5f0.tar.gz
bcm5719-llvm-6b36337c0913fc5fdb4e73678d63248bd89ff5f0.zip
[PeepholeOptimizer] Update the kill flags when extending the live-range of the
source of a copy. <rdar://problem/12702965> llvm-svn: 216229
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/PeepholeOptimizer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
index ae14331d663..98fcc2e2529 100644
--- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp
+++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
@@ -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
OpenPOWER on IntegriCloud