Put some per-instruction statistics of fast isel under NDEBUG, together with
authorEli Bendersky <eliben@google.com>
Thu, 28 Feb 2013 18:05:12 +0000 (18:05 +0000)
committerEli Bendersky <eliben@google.com>
Thu, 28 Feb 2013 18:05:12 +0000 (18:05 +0000)
other per-instruction statistics.

llvm-svn: 176273

llvm/lib/CodeGen/SelectionDAG/FastISel.cpp

index 04f5b32e0421900565a67177da8c9b4cedcb1c9b..a11f434ae00831c1ebb9a42f69339c7a3913164e 100644 (file)
 #include "llvm/Target/TargetMachine.h"
 using namespace llvm;
 
+#ifndef NDEBUG
 STATISTIC(NumFastIselSuccessIndependent, "Number of insts selected by "
           "target-independent selector");
 STATISTIC(NumFastIselSuccessTarget, "Number of insts selected by "
           "target-specific selector");
 STATISTIC(NumFastIselDead, "Number of dead insts removed on failure");
+#endif // NDEBUG
 
 /// startNewBlock - Set the current block to which generated machine
 /// instructions will be appended, and clear the local CSE map.
@@ -332,7 +334,7 @@ void FastISel::removeDeadCode(MachineBasicBlock::iterator I,
     MachineInstr *Dead = &*I;
     ++I;
     Dead->eraseFromParent();
-    ++NumFastIselDead;
+    DEBUG(++NumFastIselDead);
   }
   recomputeInsertPt();
 }
@@ -823,7 +825,7 @@ FastISel::SelectInstruction(const Instruction *I) {
 
   // First, try doing target-independent selection.
   if (SelectOperator(I, I->getOpcode())) {
-    ++NumFastIselSuccessIndependent;
+    DEBUG(++NumFastIselSuccessIndependent);
     DL = DebugLoc();
     return true;
   }
@@ -838,7 +840,7 @@ FastISel::SelectInstruction(const Instruction *I) {
   // Next, try calling the target to attempt to handle the instruction.
   SavedInsertPt = FuncInfo.InsertPt;
   if (TargetSelectInstruction(I)) {
-    ++NumFastIselSuccessTarget;
+    DEBUG(++NumFastIselSuccessTarget);
     DL = DebugLoc();
     return true;
   }