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

Unified Diff: src/IceOperand.cpp

Issue 631483002: Subzero: Optimize a common live range overlap calculation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Clear IsNonpoints during reset() Created 6 years, 2 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/IceOperand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index 26ef83089a064191b569fa88b0b34effbe4c94bc..c366dd993558f604ff6ddf7b441b5350e7c5a36c 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -37,6 +37,8 @@ bool operator==(const RegWeight &A, const RegWeight &B) {
}
void LiveRange::addSegment(InstNumberT Start, InstNumberT End) {
+ if (End > Start)
+ IsNonpoints = true;
#ifdef USE_SET
RangeElementType Element(Start, End);
RangeType::iterator Next = Range.lower_bound(Element);
@@ -122,6 +124,8 @@ bool LiveRange::overlaps(const LiveRange &Other) const {
}
bool LiveRange::overlaps(InstNumberT OtherBegin) const {
+ if (!IsNonpoints)
+ return false;
bool Result = false;
for (const RangeElementType &I : Range) {
if (OtherBegin < I.first) {
« no previous file with comments | « src/IceOperand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698