OLD | NEW |
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 IceV_InstNumbers = 1 << 2, | 98 IceV_InstNumbers = 1 << 2, |
99 IceV_Preds = 1 << 3, | 99 IceV_Preds = 1 << 3, |
100 IceV_Succs = 1 << 4, | 100 IceV_Succs = 1 << 4, |
101 IceV_Liveness = 1 << 5, | 101 IceV_Liveness = 1 << 5, |
102 IceV_RegManager = 1 << 6, | 102 IceV_RegManager = 1 << 6, |
103 IceV_RegOrigins = 1 << 7, | 103 IceV_RegOrigins = 1 << 7, |
104 IceV_LinearScan = 1 << 8, | 104 IceV_LinearScan = 1 << 8, |
105 IceV_Frame = 1 << 9, | 105 IceV_Frame = 1 << 9, |
106 IceV_Timing = 1 << 10, | 106 IceV_Timing = 1 << 10, |
107 IceV_AddrOpt = 1 << 11, | 107 IceV_AddrOpt = 1 << 11, |
108 IceV_All = ~IceV_None | 108 IceV_All = ~IceV_None, |
| 109 IceV_Most = IceV_All & ~(IceV_Timing | IceV_LinearScan) |
109 }; | 110 }; |
110 typedef uint32_t VerboseMask; | 111 typedef uint32_t VerboseMask; |
111 | 112 |
112 typedef llvm::raw_ostream Ostream; | 113 typedef llvm::raw_ostream Ostream; |
113 | 114 |
114 // TODO: Implement in terms of std::chrono after switching to C++11. | 115 // TODO: Implement in terms of std::chrono after switching to C++11. |
115 class Timer { | 116 class Timer { |
116 public: | 117 public: |
117 Timer() : Start(llvm::TimeRecord::getCurrentTime(false)) {} | 118 Timer() : Start(llvm::TimeRecord::getCurrentTime(false)) {} |
118 uint64_t getElapsedNs() const { return getElapsedSec() * 1000 * 1000 * 1000; } | 119 uint64_t getElapsedNs() const { return getElapsedSec() * 1000 * 1000 * 1000; } |
119 uint64_t getElapsedUs() const { return getElapsedSec() * 1000 * 1000; } | 120 uint64_t getElapsedUs() const { return getElapsedSec() * 1000 * 1000; } |
120 uint64_t getElapsedMs() const { return getElapsedSec() * 1000; } | 121 uint64_t getElapsedMs() const { return getElapsedSec() * 1000; } |
121 double getElapsedSec() const { | 122 double getElapsedSec() const { |
122 llvm::TimeRecord End = llvm::TimeRecord::getCurrentTime(false); | 123 llvm::TimeRecord End = llvm::TimeRecord::getCurrentTime(false); |
123 return End.getWallTime() - Start.getWallTime(); | 124 return End.getWallTime() - Start.getWallTime(); |
124 } | 125 } |
125 void printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const; | 126 void printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const; |
126 | 127 |
127 private: | 128 private: |
128 const llvm::TimeRecord Start; | 129 const llvm::TimeRecord Start; |
129 Timer(const Timer &) LLVM_DELETED_FUNCTION; | 130 Timer(const Timer &) LLVM_DELETED_FUNCTION; |
130 Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION; | 131 Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION; |
131 }; | 132 }; |
132 | 133 |
133 } // end of namespace Ice | 134 } // end of namespace Ice |
134 | 135 |
135 #endif // SUBZERO_SRC_ICEDEFS_H | 136 #endif // SUBZERO_SRC_ICEDEFS_H |
OLD | NEW |