From: Matt Arsenault Date: Thu, 20 Jul 2017 00:37:31 +0000 (+0000) Subject: Replace -print-whole-regmask with a threshold. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a3fcdae02d71a0165b59de120b12799fff5606d;p=llvm 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308572 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index afea5575a3a..017352abb32 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -73,10 +73,12 @@ using namespace llvm; -static cl::opt PrintWholeRegMask( - "print-whole-regmask", - cl::desc("Print the full contents of regmask operands in IR dumps"), - cl::init(true), cl::Hidden); +static cl::opt 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 &OS, ModuleSlotTracker &MST, unsigned MaskWord = i / 32; unsigned MaskBit = i % 32; if (getRegMask()[MaskWord] & (1 << MaskBit)) { - if (PrintWholeRegMask || NumRegsEmitted <= 10) { + if (PrintRegMaskNumRegs < 0 || + NumRegsEmitted <= static_cast(PrintRegMaskNumRegs)) { OS << " " << PrintReg(i, TRI); NumRegsEmitted++; }