[llvm-commits] [llvm] r113168 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Chris Lattner sabre at nondot.org
Mon Sep 6 13:21:47 PDT 2010


Author: lattner
Date: Mon Sep  6 15:21:47 2010
New Revision: 113168

URL: http://llvm.org/viewvc/llvm-project?rev=113168&view=rev
Log:
The "ambiguous instructions" check only produces anything with -debug,
so only do the N^2 loop with debug mode.

Modified:
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=113168&r1=113167&r2=113168&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Mon Sep  6 15:21:47 2010
@@ -1513,29 +1513,30 @@
     });
 
   // Check for ambiguous instructions.
-  unsigned NumAmbiguous = 0;
-  for (unsigned i = 0, e = Info.Instructions.size(); i != e; ++i) {
-    for (unsigned j = i + 1; j != e; ++j) {
-      InstructionInfo &A = *Info.Instructions[i];
-      InstructionInfo &B = *Info.Instructions[j];
-    
-      if (A.CouldMatchAmiguouslyWith(B)) {
-        DEBUG_WITH_TYPE("ambiguous_instrs", {
-            errs() << "warning: ambiguous instruction match:\n";
-            A.dump();
-            errs() << "\nis incomparable with:\n";
-            B.dump();
-            errs() << "\n\n";
-          });
-        ++NumAmbiguous;
+  DEBUG(unsigned NumAmbiguous = 0;
+    for (unsigned i = 0, e = Info.Instructions.size(); i != e; ++i) {
+      for (unsigned j = i + 1; j != e; ++j) {
+        InstructionInfo &A = *Info.Instructions[i];
+        InstructionInfo &B = *Info.Instructions[j];
+      
+        if (A.CouldMatchAmiguouslyWith(B)) {
+          DEBUG_WITH_TYPE("ambiguous_instrs", {
+              errs() << "warning: ambiguous instruction match:\n";
+              A.dump();
+              errs() << "\nis incomparable with:\n";
+              B.dump();
+              errs() << "\n\n";
+            });
+          ++NumAmbiguous;
+        }
       }
     }
-  }
-  if (NumAmbiguous)
-    DEBUG_WITH_TYPE("ambiguous_instrs", {
-        errs() << "warning: " << NumAmbiguous 
-               << " ambiguous instructions!\n";
-      });
+    if (NumAmbiguous)
+      DEBUG_WITH_TYPE("ambiguous_instrs", {
+          errs() << "warning: " << NumAmbiguous 
+                 << " ambiguous instructions!\n";
+        });
+  );
 
   // Write the output.
 





More information about the llvm-commits mailing list