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

Side by Side Diff: src/IceOperand.cpp

Issue 737513008: Subzero: Simplify the constant pools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Minor cleanup Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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 // This file implements the Operand class and its target-independent 10 // This file implements the Operand class and its target-independent
11 // subclasses, primarily for the methods of the Variable class. 11 // subclasses, primarily for the methods of the Variable class.
12 // 12 //
13 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
14 14
15 #include "IceCfg.h" 15 #include "IceCfg.h"
16 #include "IceCfgNode.h" 16 #include "IceCfgNode.h"
17 #include "IceInst.h" 17 #include "IceInst.h"
18 #include "IceOperand.h" 18 #include "IceOperand.h"
19 #include "IceTargetLowering.h" // dumping stack/frame pointer register 19 #include "IceTargetLowering.h" // dumping stack/frame pointer register
20 20
21 namespace Ice { 21 namespace Ice {
22 22
23 bool operator<(const RelocatableTuple &A, const RelocatableTuple &B) { 23 bool operator==(const RelocatableTuple &A, const RelocatableTuple &B) {
24 if (A.Offset != B.Offset) 24 if (A.Offset != B.Offset || A.SuppressMangling != B.SuppressMangling)
25 return A.Offset < B.Offset; 25 return false;
26 if (A.SuppressMangling != B.SuppressMangling) 26 return A.Name == B.Name;
27 return A.SuppressMangling < B.SuppressMangling;
28 return A.Name < B.Name;
29 } 27 }
30 28
31 bool operator<(const RegWeight &A, const RegWeight &B) { 29 bool operator<(const RegWeight &A, const RegWeight &B) {
32 return A.getWeight() < B.getWeight(); 30 return A.getWeight() < B.getWeight();
33 } 31 }
34 bool operator<=(const RegWeight &A, const RegWeight &B) { return !(B < A); } 32 bool operator<=(const RegWeight &A, const RegWeight &B) { return !(B < A); }
35 bool operator==(const RegWeight &A, const RegWeight &B) { 33 bool operator==(const RegWeight &A, const RegWeight &B) {
36 return !(B < A) && !(A < B); 34 return !(B < A) && !(A < B);
37 } 35 }
38 36
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 if (!ALLOW_DUMP) 518 if (!ALLOW_DUMP)
521 return Str; 519 return Str;
522 if (W.getWeight() == RegWeight::Inf) 520 if (W.getWeight() == RegWeight::Inf)
523 Str << "Inf"; 521 Str << "Inf";
524 else 522 else
525 Str << W.getWeight(); 523 Str << W.getWeight();
526 return Str; 524 return Str;
527 } 525 }
528 526
529 } // end of namespace Ice 527 } // end of namespace Ice
OLDNEW
« src/IceGlobalContext.cpp ('K') | « src/IceOperand.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698