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

Unified Diff: src/IceOperand.cpp

Issue 2172313002: Subzero : Live Range Splitting after initial Register Allocation (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 4 years, 5 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 540252b64785faa14f8ffecdbc8ef4689f75cea0..870e7fbaada65f76fe596165d919036b732cc571 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -101,15 +101,21 @@ bool operator==(const RegWeight &A, const RegWeight &B) {
return !(B < A) && !(A < B);
}
-void LiveRange::addSegment(InstNumberT Start, InstNumberT End) {
- if (!Range.empty()) {
- // Check for merge opportunity.
- InstNumberT CurrentEnd = Range.back().second;
- assert(Start >= CurrentEnd);
- if (Start == CurrentEnd) {
- Range.back().second = End;
- return;
+void LiveRange::addSegment(InstNumberT Start, InstNumberT End, CfgNode *Node) {
+ if (!getFlags().getGlobalSplitting()) {
Jim Stichnoth 2016/07/29 17:04:06 Remove the '!' and reverse the if/then/else branch
manasijm 2016/08/01 22:20:03 Done.
+ if (!Range.empty()) {
+ // Check for merge opportunity.
+ InstNumberT CurrentEnd = Range.back().second;
+ assert(Start >= CurrentEnd);
+ if (Start == CurrentEnd) {
+ Range.back().second = End;
+ return;
+ }
}
+ } else {
+ // Disable merging to make sure a live range 'segment' has a single node.
Jim Stichnoth 2016/07/29 17:04:06 I think you could still merge if the node is the s
manasijm 2016/08/01 22:20:03 Done.
+ assert(NodeMap.find(Start) == NodeMap.end());
+ NodeMap[Start] = Node;
}
Range.push_back(RangeElementType(Start, End));
}

Powered by Google App Engine
This is Rietveld 408576698