diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 | 
| commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
| tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /llvm/lib/CodeGen/MIRPrinter.cpp | |
| parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) | |
Notes
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 35 | 
1 files changed, 32 insertions, 3 deletions
| diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 1a4e21ac06a9a..e8cd3d60ccb12 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -752,8 +752,8 @@ void MIPrinter::print(const MachineInstr &MI) {      OS << "nsw ";    if (MI.getFlag(MachineInstr::IsExact))      OS << "exact "; -  if (MI.getFlag(MachineInstr::FPExcept)) -    OS << "fpexcept "; +  if (MI.getFlag(MachineInstr::NoFPExcept)) +    OS << "nofpexcept ";    OS << TII->getName(MI.getOpcode());    if (I < E) @@ -784,6 +784,13 @@ void MIPrinter::print(const MachineInstr &MI) {      MachineOperand::printSymbol(OS, *PostInstrSymbol);      NeedComma = true;    } +  if (MDNode *HeapAllocMarker = MI.getHeapAllocMarker()) { +    if (NeedComma) +      OS << ','; +    OS << " heap-alloc-marker "; +    HeapAllocMarker->printAsOperand(OS, MST); +    NeedComma = true; +  }    if (const DebugLoc &DL = MI.getDebugLoc()) {      if (NeedComma) @@ -849,7 +856,7 @@ void MIPrinter::print(const MachineInstr &MI, unsigned OpIdx,      if (ShouldPrintRegisterTies && Op.isReg() && Op.isTied() && !Op.isDef())        TiedOperandIdx = Op.getParent()->findTiedOperandIdx(OpIdx);      const TargetIntrinsicInfo *TII = MI.getMF()->getTarget().getIntrinsicInfo(); -    Op.print(OS, MST, TypeToPrint, PrintDef, /*IsStandalone=*/false, +    Op.print(OS, MST, TypeToPrint, OpIdx, PrintDef, /*IsStandalone=*/false,               ShouldPrintRegisterTies, TiedOperandIdx, TRI, TII);      break;    } @@ -867,6 +874,28 @@ void MIPrinter::print(const MachineInstr &MI, unsigned OpIdx,    }  } +void MIRFormatter::printIRValue(raw_ostream &OS, const Value &V, +                                ModuleSlotTracker &MST) { +  if (isa<GlobalValue>(V)) { +    V.printAsOperand(OS, /*PrintType=*/false, MST); +    return; +  } +  if (isa<Constant>(V)) { +    // Machine memory operands can load/store to/from constant value pointers. +    OS << '`'; +    V.printAsOperand(OS, /*PrintType=*/true, MST); +    OS << '`'; +    return; +  } +  OS << "%ir."; +  if (V.hasName()) { +    printLLVMNameWithoutPrefix(OS, V.getName()); +    return; +  } +  int Slot = MST.getCurrentFunction() ? MST.getLocalSlot(&V) : -1; +  MachineOperand::printIRSlotNumber(OS, Slot); +} +  void llvm::printMIR(raw_ostream &OS, const Module &M) {    yaml::Output Out(OS);    Out << const_cast<Module &>(M); | 
