From e4fae4d5b6ca4a10d060d9a0df14dcfdf4b8b63e Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Mon, 26 Feb 2018 15:23:42 +0000 Subject: [CodeGen] Don't omit any redundant information in -debug output In r322867, we introduced IsStandalone when printing MIR in -debug output. The default behaviour for that was: 1) If any of MBB, MI, or MO are -debug-printed separately, don't omit any redundant information. 2) When -debug-printing a MF entirely, don't print any redundant information. 3) When printing MIR, don't print any redundant information. I'd like to change 2) to: 2) When -debug-printing a MF entirely, don't omit any redundant information. Differential Revision: https://reviews.llvm.org/D43337 llvm-svn: 326094 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index cf58c33aa4ea..8fef85ff82cc 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'; -- cgit v1.2.3