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

Unified Diff: src/IceOperand.cpp

Issue 802003003: Subzero: Clean up live range construction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years 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/IceInst.h ('k') | src/IceTimerTree.def » ('j') | 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 615c81c4389e83b314fdabee8088d4541d196cbd..bf5546f1517099073ba3fa2f270b221edbd10d9c 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -33,25 +33,14 @@ bool operator==(const RegWeight &A, const RegWeight &B) {
}
void LiveRange::addSegment(InstNumberT Start, InstNumberT End) {
- if (Range.empty()) {
- Range.push_back(RangeElementType(Start, End));
- return;
- }
- // Special case for faking in-arg liveness.
- if (End < Range.front().first) {
- assert(Start < 0);
- // This is inefficient with Range as a std::vector, but there are
- // generally very few arguments compared to the total number of
- // variables with non-empty live ranges.
- Range.insert(Range.begin(), RangeElementType(Start, End));
- return;
- }
- InstNumberT CurrentEnd = Range.back().second;
- assert(Start >= CurrentEnd);
- // Check for merge opportunity.
- if (Start == CurrentEnd) {
- Range.back().second = End;
- return;
+ if (!Range.empty()) {
+ // Check for merge opportunity.
+ InstNumberT CurrentEnd = Range.back().second;
+ assert(Start >= CurrentEnd);
+ if (Start == CurrentEnd) {
+ Range.back().second = End;
+ return;
+ }
}
Range.push_back(RangeElementType(Start, End));
}
« no previous file with comments | « src/IceInst.h ('k') | src/IceTimerTree.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698