diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index cf58c33aa4e..8fef85ff82c 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -328,7 +328,7 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, bool HasLineAttributes = false; // Print the preds of this block according to the CFG. - if (!pred_empty()) { + if (!pred_empty() && IsStandalone) { if (Indexes) OS << '\t'; // Don't indent(2), align with previous line attributes. OS << "; predecessors: "; @@ -354,7 +354,7 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, << format("0x%08" PRIx32, getSuccProbability(I).getNumerator()) << ')'; } - if (!Probs.empty()) { + if (!Probs.empty() && IsStandalone) { // Print human readable probabilities as comments. OS << "; "; for (auto I = succ_begin(), E = succ_end(); I != E; ++I) { @@ -419,7 +419,7 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, if (IsInBundle) OS.indent(2) << "}\n"; - if (IrrLoopHeaderWeight) { + if (IrrLoopHeaderWeight && IsStandalone) { if (Indexes) OS << '\t'; OS.indent(2) << "; Irreducible loop header weight: " << IrrLoopHeaderWeight.getValue() << '\n'; diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 58ad3c96c34..e7a1502cc5a 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -522,9 +522,8 @@ void MachineFunction::print(raw_ostream &OS, const SlotIndexes *Indexes) const { MST.incorporateFunction(getFunction()); for (const auto &BB : *this) { OS << '\n'; - // If we print the whole function, don't print any verbose information, - // since that information is already present. - BB.print(OS, MST, Indexes, /*IsStandalone=*/false); + // If we print the whole function, print it at its most verbose level. + BB.print(OS, MST, Indexes, /*IsStandalone=*/true); } OS << "\n# End machine code for function " << getName() << ".\n\n"; |