Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: src/IceCfg.h

Issue 1147023007: Subzero: Basic Block Profiler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Named constants; fflush; clang-format. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/szrt_profiler.c ('k') | src/IceCfg.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.h
diff --git a/src/IceCfg.h b/src/IceCfg.h
index 8f74d07f1d434169c869f58359aa6bba2ccf621b..056812b6ed271bae4faef46f0de5d856569ac1e9 100644
--- a/src/IceCfg.h
+++ b/src/IceCfg.h
@@ -128,10 +128,17 @@ public:
return static_cast<T *>(TargetAssembler.get());
}
Assembler *releaseAssembler() { return TargetAssembler.release(); }
+ std::unique_ptr<VariableDeclarationList> getGlobalInits() {
+ return std::move(GlobalInits);
+ }
bool hasComputedFrame() const;
bool getFocusedTiming() const { return FocusedTiming; }
void setFocusedTiming() { FocusedTiming = true; }
+ // Returns true if Var is a global variable that is used by the profiling
+ // code.
+ static bool isProfileGlobal(const VariableDeclaration &Var);
+
// Passes over the CFG.
void translate();
// After the CFG is fully constructed, iterate over the nodes and
@@ -188,6 +195,15 @@ public:
private:
Cfg(GlobalContext *Ctx, uint32_t SequenceNumber);
+ // Adds a call to the ProfileSummary runtime function as the first instruction
+ // in this CFG's entry block.
+ void addCallToProfileSummary();
+
+ // Iterates over the basic blocks in this CFG, adding profiling code to each
+ // one of them. It returns a list with all the globals that the profiling code
+ // needs to be defined.
+ void profileBlocks();
+
GlobalContext *Ctx;
uint32_t SequenceNumber; // output order for emission
VerboseMask VMask;
@@ -209,6 +225,8 @@ private:
std::unique_ptr<TargetLowering> Target;
std::unique_ptr<VariablesMetadata> VMetadata;
std::unique_ptr<Assembler> TargetAssembler;
+ // Globals required by this CFG. Mostly used for the profiler's globals.
+ std::unique_ptr<VariableDeclarationList> GlobalInits;
// CurrentNode is maintained during dumping/emitting just for
// validating Variable::DefNode. Normally, a traversal over
« no previous file with comments | « runtime/szrt_profiler.c ('k') | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698