OLD | NEW |
---|---|
1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===// | 1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 RegNumT::BaseType RegNumT::Limit = 0; | 94 RegNumT::BaseType RegNumT::Limit = 0; |
95 | 95 |
96 bool operator<(const RegWeight &A, const RegWeight &B) { | 96 bool operator<(const RegWeight &A, const RegWeight &B) { |
97 return A.getWeight() < B.getWeight(); | 97 return A.getWeight() < B.getWeight(); |
98 } | 98 } |
99 bool operator<=(const RegWeight &A, const RegWeight &B) { return !(B < A); } | 99 bool operator<=(const RegWeight &A, const RegWeight &B) { return !(B < A); } |
100 bool operator==(const RegWeight &A, const RegWeight &B) { | 100 bool operator==(const RegWeight &A, const RegWeight &B) { |
101 return !(B < A) && !(A < B); | 101 return !(B < A) && !(A < B); |
102 } | 102 } |
103 | 103 |
104 void LiveRange::addSegment(InstNumberT Start, InstNumberT End) { | 104 void LiveRange::addSegment(InstNumberT Start, InstNumberT End, CfgNode *Node) { |
105 if (!Range.empty()) { | 105 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.
| |
106 // Check for merge opportunity. | 106 if (!Range.empty()) { |
107 InstNumberT CurrentEnd = Range.back().second; | 107 // Check for merge opportunity. |
108 assert(Start >= CurrentEnd); | 108 InstNumberT CurrentEnd = Range.back().second; |
109 if (Start == CurrentEnd) { | 109 assert(Start >= CurrentEnd); |
110 Range.back().second = End; | 110 if (Start == CurrentEnd) { |
111 return; | 111 Range.back().second = End; |
112 return; | |
113 } | |
112 } | 114 } |
115 } else { | |
116 // 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.
| |
117 assert(NodeMap.find(Start) == NodeMap.end()); | |
118 NodeMap[Start] = Node; | |
113 } | 119 } |
114 Range.push_back(RangeElementType(Start, End)); | 120 Range.push_back(RangeElementType(Start, End)); |
115 } | 121 } |
116 | 122 |
117 // Returns true if this live range ends before Other's live range starts. This | 123 // Returns true if this live range ends before Other's live range starts. This |
118 // means that the highest instruction number in this live range is less than or | 124 // means that the highest instruction number in this live range is less than or |
119 // equal to the lowest instruction number of the Other live range. | 125 // equal to the lowest instruction number of the Other live range. |
120 bool LiveRange::endsBefore(const LiveRange &Other) const { | 126 bool LiveRange::endsBefore(const LiveRange &Other) const { |
121 // Neither range should be empty, but let's be graceful. | 127 // Neither range should be empty, but let's be graceful. |
122 if (Range.empty() || Other.Range.empty()) | 128 if (Range.empty() || Other.Range.empty()) |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 if (getType() != IceType_i32 && getType() != IceType_i16 && | 655 if (getType() != IceType_i32 && getType() != IceType_i16 && |
650 getType() != IceType_i8) | 656 getType() != IceType_i8) |
651 return false; | 657 return false; |
652 // The Following checks if the signed representation of Value is between | 658 // The Following checks if the signed representation of Value is between |
653 // -Threshold/2 and +Threshold/2 | 659 // -Threshold/2 and +Threshold/2 |
654 bool largerThanThreshold = Threshold / 2 + Value >= Threshold; | 660 bool largerThanThreshold = Threshold / 2 + Value >= Threshold; |
655 return largerThanThreshold; | 661 return largerThanThreshold; |
656 } | 662 } |
657 | 663 |
658 } // end of namespace Ice | 664 } // end of namespace Ice |
OLD | NEW |