]> granicus.if.org Git - llvm/commitdiff
[Hexagon] Only increment debug counters if debug option is present
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Tue, 25 Apr 2017 18:56:14 +0000 (18:56 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Tue, 25 Apr 2017 18:56:14 +0000 (18:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301346 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonBitSimplify.cpp

index 079b7d4851f2452d467c81c0b32e4abdbe6e3d28..8502bf24c02f609d781ce852b58e4e9aeaebe281 100644 (file)
@@ -2174,8 +2174,10 @@ bool BitSimplification::genBitSplit(MachineInstr *MI,
       const RegisterSet &AVs) {
   if (!GenBitSplit)
     return false;
-  if (CountBitSplit >= MaxBitSplit)
-    return false;
+  if (MaxBitSplit.getNumOccurrences()) {
+    if (CountBitSplit >= MaxBitSplit)
+      return false;
+  }
 
   unsigned Opc = MI->getOpcode();
   switch (Opc) {
@@ -2254,7 +2256,8 @@ bool BitSimplification::genBitSplit(MachineInstr *MI,
       continue;
 
     // Generate bitsplit where S is defined.
-    CountBitSplit++;
+    if (MaxBitSplit.getNumOccurrences())
+      CountBitSplit++;
     MachineInstr *DefS = MRI.getVRegDef(S);
     assert(DefS != nullptr);
     DebugLoc DL = DefS->getDebugLoc();
@@ -2380,9 +2383,11 @@ bool BitSimplification::simplifyExtractLow(MachineInstr *MI,
       const RegisterSet &AVs) {
   if (!GenExtract)
     return false;
-  if (CountExtract >= MaxExtract)
-    return false;
-  CountExtract++;
+  if (MaxExtract.getNumOccurrences()) {
+    if (CountExtract >= MaxExtract)
+      return false;
+    CountExtract++;
+  }
 
   unsigned W = RC.width();
   unsigned RW = W;