Subzero: Rewrite the pass timing infrastructure.
This makes it much more useful for individual analysis and long-term translation performance tracking.
1. Collect and report aggregated across the entire translation, instead of function-by-function. If you really care about a single function, just extract it and translate it separately for analysis.
2. Remove "-verbose time" and just use -timing.
3. Collects two kinds of timings: cumulative and flat. Cumulative measures the total time, even if a callee also times itself. Flat only measures the currently active timer at the top of the stack. The flat times should add up to 100%, but cumulative will usually add up to much more than 100%.
BUG= none
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/610813002
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index d1854f4..3614725 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -122,9 +122,26 @@
}
bool LiveRange::overlaps(InstNumberT OtherBegin) const {
+ bool Result = false;
+ for (RangeType::const_iterator I = Range.begin(), E = Range.end(); I != E;
+ ++I) {
+ if (OtherBegin < I->first) {
+ Result = false;
+ break;
+ }
+ if (OtherBegin < I->second) {
+ Result = true;
+ break;
+ }
+ }
+#if 0
+ // An equivalent but less inefficient implementation:
LiveRange Temp;
Temp.addSegment(OtherBegin, OtherBegin + 1);
- return overlaps(Temp);
+ bool Validation = overlaps(Temp);
+ assert(Result == Validation);
+#endif
+ return Result;
}
// Returns true if the live range contains the given instruction
@@ -259,6 +276,8 @@
}
void VariablesMetadata::init() {
+ static TimerIdT IDvmetadata = GlobalContext::getTimerID("vmetadata");
+ TimerMarker T(IDvmetadata, Func->getContext());
Metadata.clear();
Metadata.resize(Func->getNumVariables());