aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 18d11e6b..19a1ede 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -129,6 +129,14 @@ MachineInstr::MachineInstr(MachineFunction &MF, const MachineInstr &MI)
for (const MachineOperand &MO : MI.operands())
addOperand(MF, MO);
+ // Replicate ties between the operands, which addOperand was not
+ // able to do reliably.
+ for (unsigned i = 0, e = getNumOperands(); i < e; ++i) {
+ MachineOperand &NewMO = getOperand(i);
+ const MachineOperand &OrigMO = MI.getOperand(i);
+ NewMO.TiedTo = OrigMO.TiedTo;
+ }
+
// Copy all the sensible flags.
setFlags(MI.Flags);
}