diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/CodeGen/TargetInstrInfo.cpp | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/CodeGen/TargetInstrInfo.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/CodeGen/TargetInstrInfo.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/contrib/libs/llvm12/lib/CodeGen/TargetInstrInfo.cpp b/contrib/libs/llvm12/lib/CodeGen/TargetInstrInfo.cpp index 165860ef1a..ab3aadc2ae 100644 --- a/contrib/libs/llvm12/lib/CodeGen/TargetInstrInfo.cpp +++ b/contrib/libs/llvm12/lib/CodeGen/TargetInstrInfo.cpp @@ -69,15 +69,15 @@ void TargetInstrInfo::insertNoop(MachineBasicBlock &MBB, llvm_unreachable("Target didn't implement insertNoop!"); } -/// insertNoops - Insert noops into the instruction stream at the specified -/// point. -void TargetInstrInfo::insertNoops(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, - unsigned Quantity) const { - for (unsigned i = 0; i < Quantity; ++i) - insertNoop(MBB, MI); -} - +/// insertNoops - Insert noops into the instruction stream at the specified +/// point. +void TargetInstrInfo::insertNoops(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MI, + unsigned Quantity) const { + for (unsigned i = 0; i < Quantity; ++i) + insertNoop(MBB, MI); +} + static bool isAsmComment(const char *Str, const MCAsmInfo &MAI) { return strncmp(Str, MAI.getCommentString().data(), MAI.getCommentString().size()) == 0; @@ -480,7 +480,7 @@ static MachineInstr *foldPatchpoint(MachineFunction &MF, MachineInstr &MI, ArrayRef<unsigned> Ops, int FrameIndex, const TargetInstrInfo &TII) { unsigned StartIdx = 0; - unsigned NumDefs = 0; + unsigned NumDefs = 0; switch (MI.getOpcode()) { case TargetOpcode::STACKMAP: { // StackMapLiveValues are foldable @@ -496,26 +496,26 @@ static MachineInstr *foldPatchpoint(MachineFunction &MF, MachineInstr &MI, case TargetOpcode::STATEPOINT: { // For statepoints, fold deopt and gc arguments, but not call arguments. StartIdx = StatepointOpers(&MI).getVarIdx(); - NumDefs = MI.getNumDefs(); + NumDefs = MI.getNumDefs(); break; } default: llvm_unreachable("unexpected stackmap opcode"); } - unsigned DefToFoldIdx = MI.getNumOperands(); - + unsigned DefToFoldIdx = MI.getNumOperands(); + // Return false if any operands requested for folding are not foldable (not // part of the stackmap's live values). for (unsigned Op : Ops) { - if (Op < NumDefs) { - assert(DefToFoldIdx == MI.getNumOperands() && "Folding multiple defs"); - DefToFoldIdx = Op; - } else if (Op < StartIdx) { - return nullptr; - } - if (MI.getOperand(Op).isTied()) + if (Op < NumDefs) { + assert(DefToFoldIdx == MI.getNumOperands() && "Folding multiple defs"); + DefToFoldIdx = Op; + } else if (Op < StartIdx) { return nullptr; + } + if (MI.getOperand(Op).isTied()) + return nullptr; } MachineInstr *NewMI = @@ -524,16 +524,16 @@ static MachineInstr *foldPatchpoint(MachineFunction &MF, MachineInstr &MI, // No need to fold return, the meta data, and function arguments for (unsigned i = 0; i < StartIdx; ++i) - if (i != DefToFoldIdx) - MIB.add(MI.getOperand(i)); + if (i != DefToFoldIdx) + MIB.add(MI.getOperand(i)); - for (unsigned i = StartIdx, e = MI.getNumOperands(); i < e; ++i) { + for (unsigned i = StartIdx, e = MI.getNumOperands(); i < e; ++i) { MachineOperand &MO = MI.getOperand(i); - unsigned TiedTo = e; - (void)MI.isRegTiedToDefOperand(i, &TiedTo); - + unsigned TiedTo = e; + (void)MI.isRegTiedToDefOperand(i, &TiedTo); + if (is_contained(Ops, i)) { - assert(TiedTo == e && "Cannot fold tied operands"); + assert(TiedTo == e && "Cannot fold tied operands"); unsigned SpillSize; unsigned SpillOffset; // Compute the spill slot size and offset. @@ -547,14 +547,14 @@ static MachineInstr *foldPatchpoint(MachineFunction &MF, MachineInstr &MI, MIB.addImm(SpillSize); MIB.addFrameIndex(FrameIndex); MIB.addImm(SpillOffset); - } else { - MIB.add(MO); - if (TiedTo < e) { - assert(TiedTo < NumDefs && "Bad tied operand"); - if (TiedTo > DefToFoldIdx) - --TiedTo; - NewMI->tieOperands(TiedTo, NewMI->getNumOperands() - 1); - } + } else { + MIB.add(MO); + if (TiedTo < e) { + assert(TiedTo < NumDefs && "Bad tied operand"); + if (TiedTo > DefToFoldIdx) + --TiedTo; + NewMI->tieOperands(TiedTo, NewMI->getNumOperands() - 1); + } } } return NewMI; @@ -778,8 +778,8 @@ bool TargetInstrInfo::isReassociationCandidate(const MachineInstr &Inst, // instruction is known to not increase the critical path, then don't match // that pattern. bool TargetInstrInfo::getMachineCombinerPatterns( - MachineInstr &Root, SmallVectorImpl<MachineCombinerPattern> &Patterns, - bool DoRegPressureReduce) const { + MachineInstr &Root, SmallVectorImpl<MachineCombinerPattern> &Patterns, + bool DoRegPressureReduce) const { bool Commute; if (isReassociationCandidate(Root, Commute)) { // We found a sequence of instructions that may be suitable for a |