X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FMIRPrinter.cpp;h=175cb0d51437aa84b4cec13c36ad6245d607384e;hb=ae4aa8b8d233366d231a10dafae68d7287512927;hp=df2f441a031c5dc18042d89d535610abbd716501;hpb=56e58395742c8bc32231689a82bf91cd431434ef;p=oota-llvm.git diff --git a/lib/CodeGen/MIRPrinter.cpp b/lib/CodeGen/MIRPrinter.cpp index df2f441a031..175cb0d5143 100644 --- a/lib/CodeGen/MIRPrinter.cpp +++ b/lib/CodeGen/MIRPrinter.cpp @@ -27,6 +27,7 @@ #include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/Module.h" #include "llvm/IR/ModuleSlotTracker.h" +#include "llvm/MC/MCSymbol.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/YAMLTraits.h" @@ -438,7 +439,7 @@ void MIPrinter::print(const MachineBasicBlock &MBB) { OS << "address-taken"; HasAttributes = true; } - if (MBB.isLandingPad()) { + if (MBB.isEHPad()) { OS << (HasAttributes ? ", " : " ("); OS << "landing-pad"; HasAttributes = true; @@ -460,8 +461,8 @@ void MIPrinter::print(const MachineBasicBlock &MBB) { if (I != MBB.succ_begin()) OS << ", "; printMBBReference(**I); - if (MBB.hasSuccessorWeights()) - OS << '(' << MBB.getSuccWeight(I) << ')'; + if (MBB.hasSuccessorProbabilities()) + OS << '(' << MBB.getSuccProbability(I) << ')'; } OS << "\n"; HasLineAttributes = true; @@ -472,10 +473,14 @@ void MIPrinter::print(const MachineBasicBlock &MBB) { assert(TRI && "Expected target register info"); if (!MBB.livein_empty()) { OS.indent(2) << "liveins: "; - for (auto I = MBB.livein_begin(), E = MBB.livein_end(); I != E; ++I) { - if (I != MBB.livein_begin()) + bool First = true; + for (const auto &LI : MBB.liveins()) { + if (!First) OS << ", "; - printReg(*I, OS, TRI); + First = false; + printReg(LI.PhysReg, OS, TRI); + if (LI.LaneMask != ~0u) + OS << ':' << PrintLaneMask(LI.LaneMask); } OS << "\n"; HasLineAttributes = true; @@ -608,13 +613,23 @@ void MIPrinter::printIRBlockReference(const BasicBlock &BB) { } void MIPrinter::printIRValueReference(const Value &V) { + if (isa(V)) { + V.printAsOperand(OS, /*PrintType=*/false, MST); + return; + } + if (isa(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; } - // TODO: Serialize the unnamed IR value references. - OS << ""; + printIRSlotNumber(OS, MST.getLocalSlot(&V)); } void MIPrinter::printStackObjectReference(int FrameIndex) { @@ -817,14 +832,14 @@ void MIPrinter::print(const MachineOperand &Op, const TargetRegisterInfo *TRI, case MachineOperand::MO_Metadata: Op.getMetadata()->printAsOperand(OS, MST); break; + case MachineOperand::MO_MCSymbol: + OS << ""; + break; case MachineOperand::MO_CFIIndex: { const auto &MMI = Op.getParent()->getParent()->getParent()->getMMI(); print(MMI.getFrameInstructions()[Op.getCFIIndex()], TRI); break; } - default: - // TODO: Print the other machine operands. - llvm_unreachable("Can't print this machine operand at the moment"); } } @@ -867,11 +882,12 @@ void MIPrinter::print(const MachineMemOperand &Op) { cast(PVal)->getFrameIndex()); break; case PseudoSourceValue::GlobalValueCallEntry: + OS << "call-entry "; cast(PVal)->getValue()->printAsOperand( OS, /*PrintType=*/false, MST); break; case PseudoSourceValue::ExternalSymbolCallEntry: - OS << '$'; + OS << "call-entry $"; printLLVMNameWithoutPrefix( OS, cast(PVal)->getSymbol()); break;