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

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: Add comment Created 4 years, 4 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') | src/IceRegAlloc.h » ('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 540252b64785faa14f8ffecdbc8ef4689f75cea0..e34415e134aa94c04131f30fe5c3c5bbc491408a 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -101,14 +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().getSplitGlobalVars()) {
+ // Disable merging to make sure a live range 'segment' has a single node.
+ // Might be possible to enable when the target segment has the same node.
+ assert(NodeMap.find(Start) == NodeMap.end());
+ NodeMap[Start] = Node;
+ } else {
+ 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/IceOperand.h ('k') | src/IceRegAlloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698