[llvm-commits] [llvm] r112812 - in /llvm/trunk: lib/VMCore/AsmWriter.cpp test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll

Duncan Sands baldrick at free.fr
Thu Sep 2 01:52:23 PDT 2010


Author: baldrick
Date: Thu Sep  2 03:52:23 2010
New Revision: 112812

URL: http://llvm.org/viewvc/llvm-project?rev=112812&view=rev
Log:
Print the number of uses of a function in the .ll since it can be informative
and there seems to be no reason not to.

Modified:
    llvm/trunk/lib/VMCore/AsmWriter.cpp
    llvm/trunk/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=112812&r1=112811&r2=112812&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Thu Sep  2 03:52:23 2010
@@ -1635,9 +1635,9 @@
   if (F->hasGC())
     Out << " gc \"" << F->getGC() << '"';
   if (F->isDeclaration()) {
-    Out << "\n";
+    Out << " ; [#uses=" << F->getNumUses() << "]\n";  // Output # uses
   } else {
-    Out << " {";
+    Out << " { ; [#uses=" << F->getNumUses() << ']';  // Output # uses
 
     // Output all of its basic blocks... for the function
     for (Function::const_iterator I = F->begin(), E = F->end(); I != E; ++I)

Modified: llvm/trunk/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll?rev=112812&r1=112811&r2=112812&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/2003-12-10-IndVarDeadCode.ll Thu Sep  2 03:52:23 2010
@@ -1,8 +1,7 @@
 ; The induction variable canonicalization pass shouldn't leave dead
 ; instructions laying around!
 ;
-; RUN: opt < %s -indvars -S | \
-; RUN:   not grep {#uses=0}
+; RUN: opt < %s -indvars -S | grep {#uses=0} | count 1
 
 define i32 @mul(i32 %x, i32 %y) {
 entry:





More information about the llvm-commits mailing list