diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-03-14 21:52:13 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-03-14 21:52:13 +0000 |
commit | e85b06d65f695c576df1e529ee37cb15e6902401 (patch) | |
tree | 8cc427373ec791f148ac34dd3f8153e4b6727aed /llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp | |
parent | ca5cc20e5163f0ee16a51832ac21ed5d6d20529f (diff) | |
download | bcm5719-llvm-e85b06d65f695c576df1e529ee37cb15e6902401.tar.gz bcm5719-llvm-e85b06d65f695c576df1e529ee37cb15e6902401.zip |
[CodeGen] Use MIR syntax for MachineMemOperand printing
Get rid of the "; mem:" suffix and use the one we use in MIR: ":: (load 2)".
rdar://38163529
Differential Revision: https://reviews.llvm.org/D42377
llvm-svn: 327580
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp index 4c58fb17ac1..2810090d067 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -34,6 +34,7 @@ #include "llvm/IR/DebugLoc.h" #include "llvm/IR/Function.h" #include "llvm/IR/Intrinsics.h" +#include "llvm/IR/ModuleSlotTracker.h" #include "llvm/IR/Value.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" @@ -422,6 +423,19 @@ static Printable PrintNodeId(const SDNode &Node) { }); } +// Print the MMO with more information from the SelectionDAG. +static void printMemOperand(raw_ostream &OS, const MachineMemOperand &MMO, + const SelectionDAG *G) { + const MachineFunction &MF = G->getMachineFunction(); + const Function &F = MF.getFunction(); + const MachineFrameInfo &MFI = MF.getFrameInfo(); + const TargetInstrInfo *TII = G->getSubtarget().getInstrInfo(); + ModuleSlotTracker MST(F.getParent()); + MST.incorporateFunction(F); + SmallVector<StringRef, 0> SSNs; + MMO.print(OS, MST, SSNs, *G->getContext(), &MFI, TII); +} + #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void SDNode::dump() const { dump(nullptr); } @@ -478,7 +492,7 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const { OS << "Mem:"; for (MachineSDNode::mmo_iterator i = MN->memoperands_begin(), e = MN->memoperands_end(); i != e; ++i) { - OS << **i; + printMemOperand(OS, **i, G); if (std::next(i) != e) OS << " "; } @@ -570,7 +584,9 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const { OS << ":" << N->getVT().getEVTString(); } else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(this)) { - OS << "<" << *LD->getMemOperand(); + OS << "<"; + + printMemOperand(OS, *LD->getMemOperand(), G); bool doExt = true; switch (LD->getExtensionType()) { @@ -588,7 +604,8 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const { OS << ">"; } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(this)) { - OS << "<" << *ST->getMemOperand(); + OS << "<"; + printMemOperand(OS, *ST->getMemOperand(), G); if (ST->isTruncatingStore()) OS << ", trunc to " << ST->getMemoryVT().getEVTString(); @@ -599,7 +616,9 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const { OS << ">"; } else if (const MemSDNode* M = dyn_cast<MemSDNode>(this)) { - OS << "<" << *M->getMemOperand() << ">"; + OS << "<"; + printMemOperand(OS, *M->getMemOperand(), G); + OS << ">"; } else if (const BlockAddressSDNode *BA = dyn_cast<BlockAddressSDNode>(this)) { int64_t offset = BA->getOffset(); |