[PATCH] D29461: [ThinLTO] PrintStatistics when we exit early for thinlto-index-only

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 09:45:20 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL293908: [ThinLTO] PrintStatistics when we exit early for thinlto-index-only (authored by tejohnson).

Changed prior to commit:
  https://reviews.llvm.org/D29461?vs=86838&id=86840#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29461

Files:
  llvm/trunk/test/tools/gold/X86/stats.ll
  llvm/trunk/tools/gold/gold-plugin.cpp


Index: llvm/trunk/tools/gold/gold-plugin.cpp
===================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp
+++ llvm/trunk/tools/gold/gold-plugin.cpp
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/ADT/Statistic.h"
 #include "llvm/Bitcode/BitcodeReader.h"
 #include "llvm/Bitcode/BitcodeWriter.h"
 #include "llvm/CodeGen/CommandFlags.h"
@@ -844,6 +845,8 @@
     return LDPS_OK;
 
   if (options::thinlto_index_only) {
+    if (llvm::AreStatisticsEnabled())
+      llvm::PrintStatistics();
     cleanup_hook();
     exit(0);
   }
Index: llvm/trunk/test/tools/gold/X86/stats.ll
===================================================================
--- llvm/trunk/test/tools/gold/X86/stats.ll
+++ llvm/trunk/test/tools/gold/X86/stats.ll
@@ -5,6 +5,13 @@
 ; RUN:    -m elf_x86_64 \
 ; RUN:    -plugin-opt=-stats %t.o -o %t2 2>&1 | FileCheck %s
 
+; RUN: llvm-as %s -o %t.o
+; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so  -shared \
+; RUN:    -m elf_x86_64 \
+; RUN:    -plugin-opt=thinlto \
+; RUN:    -plugin-opt=thinlto-index-only \
+; RUN:    -plugin-opt=-stats %t.o -o %t2 2>&1 | FileCheck %s
+
 ; CHECK: Statistics Collected
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29461.86840.patch
Type: text/x-patch
Size: 1309 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170202/44cec938/attachment.bin>


More information about the llvm-commits mailing list