forked from OSchip/llvm-project
[ThinLTO] Correct counting of functions in inliner stats
Summary: Declarations need to be filtered out when counting functions. Reviewers: eraman Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D31336 llvm-svn: 298720
This commit is contained in:
parent
80e3d5bb24
commit
428b9e0627
|
@ -62,6 +62,8 @@ void ImportedFunctionsInliningStatistics::recordInline(const Function &Caller,
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -36,9 +36,12 @@ define void @internal3() {
|
|||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue