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

Unified Diff: src/IceOperand.cpp

Issue 610813002: Subzero: Rewrite the pass timing infrastructure. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Bug fixes and performance improvements Created 6 years, 3 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
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index d1854f4f0f0a6d4e48306b87acef22f227f2b84b..3a10a6a5159470ad5be882aa75e586d72706bed3 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -122,9 +122,19 @@ bool LiveRange::overlaps(const LiveRange &Other) const {
}
bool LiveRange::overlaps(InstNumberT OtherBegin) const {
Jim Stichnoth 2014/09/28 14:26:39 This is called quite a bit, so provide a better im
+ for (RangeType::const_iterator I = Range.begin(), E = Range.end(); I != E;
+ ++I) {
+ if (OtherBegin >= I->second)
+ return false;
+ if (I->first <= OtherBegin)
+ return true;
+ }
+ return false;
+#if 0 // An equivalent but less inefficient implementation:
LiveRange Temp;
Temp.addSegment(OtherBegin, OtherBegin + 1);
return overlaps(Temp);
+#endif
}
// Returns true if the live range contains the given instruction
@@ -259,6 +269,7 @@ const Inst *VariableTracking::getSingleDefinition() const {
}
void VariablesMetadata::init() {
+ TimerMarker T("vmetadata", Func->getContext());
Metadata.clear();
Metadata.resize(Func->getNumVariables());

Powered by Google App Engine
This is Rietveld 408576698