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

Side by Side Diff: src/IceDefs.h

Issue 456033003: Subzero: Randomize register assignment. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Typo Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/IceRNG.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===// 1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===//
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 declares various useful types and classes that have 10 // This file declares various useful types and classes that have
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 IceV_Deleted = 1 << 1, 94 IceV_Deleted = 1 << 1,
95 IceV_InstNumbers = 1 << 2, 95 IceV_InstNumbers = 1 << 2,
96 IceV_Preds = 1 << 3, 96 IceV_Preds = 1 << 3,
97 IceV_Succs = 1 << 4, 97 IceV_Succs = 1 << 4,
98 IceV_Liveness = 1 << 5, 98 IceV_Liveness = 1 << 5,
99 IceV_RegManager = 1 << 6, 99 IceV_RegManager = 1 << 6,
100 IceV_RegOrigins = 1 << 7, 100 IceV_RegOrigins = 1 << 7,
101 IceV_LinearScan = 1 << 8, 101 IceV_LinearScan = 1 << 8,
102 IceV_Frame = 1 << 9, 102 IceV_Frame = 1 << 9,
103 IceV_Timing = 1 << 10, 103 IceV_Timing = 1 << 10,
104 IceV_Random = 1 << 11,
104 IceV_All = ~IceV_None 105 IceV_All = ~IceV_None
105 }; 106 };
106 typedef uint32_t VerboseMask; 107 typedef uint32_t VerboseMask;
107 108
108 typedef llvm::raw_ostream Ostream; 109 typedef llvm::raw_ostream Ostream;
109 110
110 // TODO: Implement in terms of std::chrono after switching to C++11. 111 // TODO: Implement in terms of std::chrono after switching to C++11.
111 class Timer { 112 class Timer {
112 public: 113 public:
113 Timer() : Start(llvm::TimeRecord::getCurrentTime(false)) {} 114 Timer() : Start(llvm::TimeRecord::getCurrentTime(false)) {}
114 uint64_t getElapsedNs() const { return getElapsedSec() * 1000 * 1000 * 1000; } 115 uint64_t getElapsedNs() const { return getElapsedSec() * 1000 * 1000 * 1000; }
115 uint64_t getElapsedUs() const { return getElapsedSec() * 1000 * 1000; } 116 uint64_t getElapsedUs() const { return getElapsedSec() * 1000 * 1000; }
116 uint64_t getElapsedMs() const { return getElapsedSec() * 1000; } 117 uint64_t getElapsedMs() const { return getElapsedSec() * 1000; }
117 double getElapsedSec() const { 118 double getElapsedSec() const {
118 llvm::TimeRecord End = llvm::TimeRecord::getCurrentTime(false); 119 llvm::TimeRecord End = llvm::TimeRecord::getCurrentTime(false);
119 return End.getWallTime() - Start.getWallTime(); 120 return End.getWallTime() - Start.getWallTime();
120 } 121 }
121 void printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const; 122 void printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const;
122 123
123 private: 124 private:
124 const llvm::TimeRecord Start; 125 const llvm::TimeRecord Start;
125 Timer(const Timer &) LLVM_DELETED_FUNCTION; 126 Timer(const Timer &) LLVM_DELETED_FUNCTION;
126 Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION; 127 Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION;
127 }; 128 };
128 129
129 } // end of namespace Ice 130 } // end of namespace Ice
130 131
131 #endif // SUBZERO_SRC_ICEDEFS_H 132 #endif // SUBZERO_SRC_ICEDEFS_H
OLDNEW
« no previous file with comments | « no previous file | src/IceRNG.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698