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

Unified Diff: src/IceCfg.cpp

Issue 1900543002: Subzero: Allow per-method controls. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: More cleanup Created 4 years, 8 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 | « src/IceCfg.h ('k') | src/IceClFlags.h » ('j') | src/IceClFlags.def » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index 285b489ecce92ea61b7601add9664520fe872450..0ff94b4c6d58ebdbc2cda930514d87de520e927d 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -197,20 +197,25 @@ void Cfg::addCallToProfileSummary() {
void Cfg::translate() {
if (hasError())
return;
+ // Cache the possibly-overridden optimization level once translation begins.
+ // It would be nicer to do this in the constructor, but we need to wait until
+ // after setFunctionName() has a chance to be called.
+ OptimizationLevel =
+ getFlags().matchForceO2(getFunctionName(), getSequenceNumber())
+ ? Opt_2
+ : getFlags().getOptLevel();
if (BuildDefs::timers()) {
- const std::string TimingFocusOn = getFlags().getTimingFocusOn();
- if (!TimingFocusOn.empty()) {
- const std::string Name = getFunctionName().toString();
- if (TimingFocusOn == "*" || TimingFocusOn == Name) {
- setFocusedTiming();
- getContext()->resetTimer(GlobalContext::TSK_Default);
- }
+ if (getFlags().matchTimingFocus(getFunctionName(), getSequenceNumber())) {
+ setFocusedTiming();
+ getContext()->resetTimer(GlobalContext::TSK_Default);
}
}
if (BuildDefs::dump()) {
- if (isVerbose(IceV_Status)) {
+ if (isVerbose(IceV_Status) &&
+ getFlags().matchTestStatus(getFunctionName(), getSequenceNumber())) {
getContext()->getStrDump() << ">>>Translating "
- << getFunctionNameAndSize() << "\n";
+ << getFunctionNameAndSize()
+ << " seq=" << getSequenceNumber() << "\n";
}
}
TimerMarker T_func(getContext(), getFunctionName().toStringOrEmpty());
@@ -222,7 +227,7 @@ void Cfg::translate() {
profileBlocks();
// TODO(jpp): this is fragile, at best. Figure out a better way of
// detecting exit functions.
- if (GlobalContext::matchSymbolName(getFunctionName(), "exit")) {
+ if (getFunctionName().toStringOrEmpty() == "exit") {
addCallToProfileSummary();
}
dump("Profiled CFG");
« no previous file with comments | « src/IceCfg.h ('k') | src/IceClFlags.h » ('j') | src/IceClFlags.def » ('J')

Powered by Google App Engine
This is Rietveld 408576698