OLD | NEW |
1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// | 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- 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 aspects of the compilation that persist across | 10 // This file declares aspects of the compilation that persist across |
(...skipping 29 matching lines...) Expand all Loading... |
40 public: | 40 public: |
41 CodeStats() | 41 CodeStats() |
42 : InstructionsEmitted(0), RegistersSaved(0), FrameBytes(0), Spills(0), | 42 : InstructionsEmitted(0), RegistersSaved(0), FrameBytes(0), Spills(0), |
43 Fills(0) {} | 43 Fills(0) {} |
44 void reset() { *this = CodeStats(); } | 44 void reset() { *this = CodeStats(); } |
45 void updateEmitted(uint32_t InstCount) { InstructionsEmitted += InstCount; } | 45 void updateEmitted(uint32_t InstCount) { InstructionsEmitted += InstCount; } |
46 void updateRegistersSaved(uint32_t Num) { RegistersSaved += Num; } | 46 void updateRegistersSaved(uint32_t Num) { RegistersSaved += Num; } |
47 void updateFrameBytes(uint32_t Bytes) { FrameBytes += Bytes; } | 47 void updateFrameBytes(uint32_t Bytes) { FrameBytes += Bytes; } |
48 void updateSpills() { ++Spills; } | 48 void updateSpills() { ++Spills; } |
49 void updateFills() { ++Fills; } | 49 void updateFills() { ++Fills; } |
50 void dump(const IceString &Name, Ostream &Str) { | 50 void dump(const IceString &Name, Ostream &Str); |
51 if (!ALLOW_DUMP) | |
52 return; | |
53 Str << "|" << Name << "|Inst Count |" << InstructionsEmitted << "\n"; | |
54 Str << "|" << Name << "|Regs Saved |" << RegistersSaved << "\n"; | |
55 Str << "|" << Name << "|Frame Bytes |" << FrameBytes << "\n"; | |
56 Str << "|" << Name << "|Spills |" << Spills << "\n"; | |
57 Str << "|" << Name << "|Fills |" << Fills << "\n"; | |
58 Str << "|" << Name << "|Spills+Fills|" << Spills + Fills << "\n"; | |
59 } | |
60 | 51 |
61 private: | 52 private: |
62 uint32_t InstructionsEmitted; | 53 uint32_t InstructionsEmitted; |
63 uint32_t RegistersSaved; | 54 uint32_t RegistersSaved; |
64 uint32_t FrameBytes; | 55 uint32_t FrameBytes; |
65 uint32_t Spills; | 56 uint32_t Spills; |
66 uint32_t Fills; | 57 uint32_t Fills; |
67 }; | 58 }; |
68 | 59 |
69 // TODO: Accesses to all non-const fields of GlobalContext need to | 60 // TODO: Accesses to all non-const fields of GlobalContext need to |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 254 |
264 private: | 255 private: |
265 TimerIdT ID; | 256 TimerIdT ID; |
266 GlobalContext *const Ctx; | 257 GlobalContext *const Ctx; |
267 bool Active; | 258 bool Active; |
268 }; | 259 }; |
269 | 260 |
270 } // end of namespace Ice | 261 } // end of namespace Ice |
271 | 262 |
272 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 263 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
OLD | NEW |