diff options
author | Simon Tatham <simon.tatham@arm.com> | 2022-10-13 09:18:31 +0100 |
---|---|---|
committer | Simon Tatham <simon.tatham@arm.com> | 2022-10-13 09:40:35 +0100 |
commit | 526ce9c9299ad1f8c2c5971204066dd02e528199 (patch) | |
tree | 9af6f9257e37b8b344c8890bac832ebd1c589674 /llvm/lib/CodeGen/ModuloSchedule.cpp | |
parent | 89c923655aad6de837e386aa6e1dfa72c16e2697 (diff) | |
download | llvm-526ce9c9299ad1f8c2c5971204066dd02e528199.zip llvm-526ce9c9299ad1f8c2c5971204066dd02e528199.tar.gz llvm-526ce9c9299ad1f8c2c5971204066dd02e528199.tar.bz2 |
Propagate tied operands when copying a MachineInstr.
MachineInstr's copy constructor works by calling the addOperand method
to add each operand of the old MachineInstr to the new one, one by
one. But addOperand deliberately avoids trying to replicate ties
between operands, on the grounds that the tie refers to operands by
index, and the indices aren't necessarily finalized yet.
This led to a code generation fault when the machine pipeliner cloned
an Arm conditional instruction, and lost the tie between the output
register and the input value to be used when the condition failed to
execute.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D135434
Diffstat (limited to 'llvm/lib/CodeGen/ModuloSchedule.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ModuloSchedule.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp index d689e8e..c7fde45 100644 --- a/llvm/lib/CodeGen/ModuloSchedule.cpp +++ b/llvm/lib/CodeGen/ModuloSchedule.cpp @@ -998,17 +998,6 @@ MachineInstr *ModuloScheduleExpander::cloneInstr(MachineInstr *OldMI, unsigned CurStageNum, unsigned InstStageNum) { MachineInstr *NewMI = MF.CloneMachineInstr(OldMI); - // Check for tied operands in inline asm instructions. This should be handled - // elsewhere, but I'm not sure of the best solution. - if (OldMI->isInlineAsm()) - for (unsigned i = 0, e = OldMI->getNumOperands(); i != e; ++i) { - const auto &MO = OldMI->getOperand(i); - if (MO.isReg() && MO.isUse()) - break; - unsigned UseIdx; - if (OldMI->isRegTiedToUseOperand(i, &UseIdx)) - NewMI->tieOperands(i, UseIdx); - } updateMemOperands(*NewMI, *OldMI, CurStageNum - InstStageNum); return NewMI; } |