[lld] r247868 - COFF: ICF: Print out the number of iterations. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 16:55:40 PDT 2015


Author: ruiu
Date: Wed Sep 16 18:55:39 2015
New Revision: 247868

URL: http://llvm.org/viewvc/llvm-project?rev=247868&view=rev
Log:
COFF: ICF: Print out the number of iterations. NFC.

Modified:
    lld/trunk/COFF/ICF.cpp

Modified: lld/trunk/COFF/ICF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/ICF.cpp?rev=247868&r1=247867&r2=247868&view=diff
==============================================================================
--- lld/trunk/COFF/ICF.cpp (original)
+++ lld/trunk/COFF/ICF.cpp Wed Sep 16 18:55:39 2015
@@ -77,8 +77,6 @@ private:
 
 // Entry point to ICF.
 void doICF(const std::vector<Chunk *> &Chunks) {
-  if (Config->Verbose)
-    llvm::outs() << "\nICF\n";
   ICF(Chunks).run();
 }
 
@@ -200,8 +198,12 @@ void ICF::run() {
   }
 
   // Split groups until we get a convergence.
+  int Cnt = 1;
   forEachGroup(SChunks, equalsConstant);
-  while (forEachGroup(SChunks, equalsVariable));
+  while (forEachGroup(SChunks, equalsVariable))
+    ++Cnt;
+  if (Config->Verbose)
+    llvm::outs() << "\nICF needed " << Cnt << " iterations.\n";
 
   // Merge sections in the same group.
   for (auto It = SChunks.begin(), End = SChunks.end(); It != End;) {




More information about the llvm-commits mailing list