]> granicus.if.org Git - llvm/commitdiff
Replace -print-whole-regmask with a threshold.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 20 Jul 2017 00:37:31 +0000 (00:37 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 20 Jul 2017 00:37:31 +0000 (00:37 +0000)
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

lib/CodeGen/MachineInstr.cpp

index afea5575a3ae5392b1c001d6c0b603206810641c..017352abb320535cbc2d326097e1a6279fc0f510 100644 (file)
 
 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 &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<unsigned>(PrintRegMaskNumRegs)) {
           OS << " " << PrintReg(i, TRI);
           NumRegsEmitted++;
         }