summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineCopyPropagation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/MachineCopyPropagation.cpp')
-rw-r--r--lib/CodeGen/MachineCopyPropagation.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/CodeGen/MachineCopyPropagation.cpp b/lib/CodeGen/MachineCopyPropagation.cpp
index 5de6dec29fb9d..7312dc5e94bdd 100644
--- a/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/lib/CodeGen/MachineCopyPropagation.cpp
@@ -291,17 +291,9 @@ void MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
if (MO.isDef()) {
Defs.push_back(Reg);
- } else {
+ continue;
+ } else if (MO.readsReg())
ReadRegister(Reg);
- }
- // Treat undef use like defs for copy propagation but not for
- // dead copy. We would need to do a liveness check to be sure the copy
- // is dead for undef uses.
- // The backends are allowed to do whatever they want with undef value
- // and we cannot be sure this register will not be rewritten to break
- // some false dependencies for the hardware for instance.
- if (MO.isUndef())
- Defs.push_back(Reg);
}
// The instruction has a register mask operand which means that it clobbers