[llvm] r308572 - Replace -print-whole-regmask with a threshold.
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 19 17:37:32 PDT 2017
Author: arsenm
Date: Wed Jul 19 17:37:31 2017
New Revision: 308572
URL: http://llvm.org/viewvc/llvm-project?rev=308572&view=rev
Log:
Replace -print-whole-regmask with a threshold.
The previous flag/default of printing everything is
not helpful when there are thousands of registers
in the mask.
Modified:
llvm/trunk/lib/CodeGen/MachineInstr.cpp
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=308572&r1=308571&r2=308572&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Wed Jul 19 17:37:31 2017
@@ -73,10 +73,12 @@
using namespace llvm;
-static cl::opt<bool> PrintWholeRegMask(
- "print-whole-regmask",
- cl::desc("Print the full contents of regmask operands in IR dumps"),
- cl::init(true), cl::Hidden);
+static cl::opt<int> PrintRegMaskNumRegs(
+ "print-regmask-num-regs",
+ cl::desc("Number of registers to limit to when "
+ "printing regmask operands in IR dumps. "
+ "unlimited = -1"),
+ cl::init(32), cl::Hidden);
//===----------------------------------------------------------------------===//
// MachineOperand Implementation
@@ -503,7 +505,8 @@ void MachineOperand::print(raw_ostream &
unsigned MaskWord = i / 32;
unsigned MaskBit = i % 32;
if (getRegMask()[MaskWord] & (1 << MaskBit)) {
- if (PrintWholeRegMask || NumRegsEmitted <= 10) {
+ if (PrintRegMaskNumRegs < 0 ||
+ NumRegsEmitted <= static_cast<unsigned>(PrintRegMaskNumRegs)) {
OS << " " << PrintReg(i, TRI);
NumRegsEmitted++;
}
More information about the llvm-commits
mailing list