PGO: Statically generate data structures

In instrumentation-based profiling, we need a set of data structures to
represent the counters.  Previously, these were built up during static
initialization.  Now, they're shoved into a specially-named section so
that they show up as an array.

As a consequence of the reorganizing symbols, instrumentation data
structures for linkonce functions are now correctly coalesced.

This is the first step in a larger project to minimize runtime overhead
and dependencies in instrumentation-based profilng.  The larger picture
includes removing all initialization overhead and making the dependency
on libc optional.

<rdar://problem/15943240>

llvm-svn: 204080
This commit is contained in:
Duncan P. N. Exon Smith
2014-03-17 21:18:30 +00:00
parent 77a88e3064
commit 2fe531cb07
12 changed files with 247 additions and 118 deletions

View File

@@ -507,7 +507,7 @@ void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) {
Cnt.beginRegion(Builder);
EmitCompoundStmtWithoutScope(*cast<CompoundStmt>(OMD->getBody()));
FinishFunction(OMD->getBodyRBrace());
PGO.emitWriteoutFunction();
PGO.emitInstrumentationData();
PGO.destroyRegionCounters();
}