[PATCH] D31336: [ThinLTO] Correct counting of functions in inliner stats
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 24 11:11:30 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL298720: [ThinLTO] Correct counting of functions in inliner stats (authored by tejohnson).
Changed prior to commit:
https://reviews.llvm.org/D31336?vs=92958&id=92979#toc
Repository:
rL LLVM
https://reviews.llvm.org/D31336
Files:
llvm/trunk/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
llvm/trunk/test/Transforms/Inline/inline_stats.ll
Index: llvm/trunk/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
+++ llvm/trunk/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp
@@ -62,6 +62,8 @@
void ImportedFunctionsInliningStatistics::setModuleInfo(const Module &M) {
ModuleName = M.getName();
for (const auto &F : M.functions()) {
+ if (F.isDeclaration())
+ continue;
AllFunctions++;
ImportedFunctions += int(F.getMetadata("thinlto_src_module") != nullptr);
}
Index: llvm/trunk/test/Transforms/Inline/inline_stats.ll
===================================================================
--- llvm/trunk/test/Transforms/Inline/inline_stats.ll
+++ llvm/trunk/test/Transforms/Inline/inline_stats.ll
@@ -36,9 +36,12 @@
ret void
}
+declare void @external_decl()
+
define void @external1() alwaysinline !thinlto_src_module !0 {
call fastcc void @internal2()
call fastcc void @external2();
+ call void @external_decl();
ret void
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31336.92979.patch
Type: text/x-patch
Size: 1104 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170324/704fb053/attachment.bin>
More information about the llvm-commits
mailing list