| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // CodeStats collects rudimentary statistics during translation. | 65 // CodeStats collects rudimentary statistics during translation. |
| 66 class CodeStats { | 66 class CodeStats { |
| 67 CodeStats(const CodeStats &) = delete; | 67 CodeStats(const CodeStats &) = delete; |
| 68 CodeStats &operator=(const CodeStats &) = default; | 68 CodeStats &operator=(const CodeStats &) = default; |
| 69 #define CODESTATS_TABLE \ | 69 #define CODESTATS_TABLE \ |
| 70 /* dump string, enum value */ \ | 70 /* dump string, enum value */ \ |
| 71 X("Inst Count ", InstCount) \ | 71 X("Inst Count ", InstCount) \ |
| 72 X("Regs Saved ", RegsSaved) \ | 72 X("Regs Saved ", RegsSaved) \ |
| 73 X("Frame Bytes ", FrameByte) \ | 73 X("Frame Bytes ", FrameByte) \ |
| 74 X("Spills ", NumSpills) \ | 74 X("Spills ", NumSpills) \ |
| 75 X("Fills ", NumFills) | 75 X("Fills ", NumFills) \ |
| 76 X("R/P Imms ", NumRPImms) |
| 76 //#define X(str, tag) | 77 //#define X(str, tag) |
| 77 | 78 |
| 78 public: | 79 public: |
| 79 enum CSTag { | 80 enum CSTag { |
| 80 #define X(str, tag) CS_##tag, | 81 #define X(str, tag) CS_##tag, |
| 81 CODESTATS_TABLE | 82 CODESTATS_TABLE |
| 82 #undef X | 83 #undef X |
| 83 CS_NUM | 84 CS_NUM |
| 84 }; | 85 }; |
| 85 CodeStats() { reset(); } | 86 CodeStats() { reset(); } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 Tls->StatsCumulative.update(CodeStats::CS_NumSpills); | 257 Tls->StatsCumulative.update(CodeStats::CS_NumSpills); |
| 257 } | 258 } |
| 258 void statsUpdateFills() { | 259 void statsUpdateFills() { |
| 259 if (!getFlags().getDumpStats()) | 260 if (!getFlags().getDumpStats()) |
| 260 return; | 261 return; |
| 261 ThreadContext *Tls = ICE_TLS_GET_FIELD(TLS); | 262 ThreadContext *Tls = ICE_TLS_GET_FIELD(TLS); |
| 262 Tls->StatsFunction.update(CodeStats::CS_NumFills); | 263 Tls->StatsFunction.update(CodeStats::CS_NumFills); |
| 263 Tls->StatsCumulative.update(CodeStats::CS_NumFills); | 264 Tls->StatsCumulative.update(CodeStats::CS_NumFills); |
| 264 } | 265 } |
| 265 | 266 |
| 267 // Number of Randomized or Pooled Immediates |
| 268 void statsUpdateRPImms() { |
| 269 if (!getFlags().getDumpStats()) |
| 270 return; |
| 271 ThreadContext *Tls = ICE_TLS_GET_FIELD(TLS); |
| 272 Tls->StatsFunction.update(CodeStats::CS_NumRPImms); |
| 273 Tls->StatsCumulative.update(CodeStats::CS_NumRPImms); |
| 274 } |
| 275 |
| 266 // These are predefined TimerStackIdT values. | 276 // These are predefined TimerStackIdT values. |
| 267 enum TimerStackKind { TSK_Default = 0, TSK_Funcs, TSK_Num }; | 277 enum TimerStackKind { TSK_Default = 0, TSK_Funcs, TSK_Num }; |
| 268 | 278 |
| 269 // newTimerStackID() creates a new TimerStack in the global space. | 279 // newTimerStackID() creates a new TimerStack in the global space. |
| 270 // It does not affect any TimerStack objects in TLS. | 280 // It does not affect any TimerStack objects in TLS. |
| 271 TimerStackIdT newTimerStackID(const IceString &Name); | 281 TimerStackIdT newTimerStackID(const IceString &Name); |
| 272 // dumpTimers() dumps the global timer data. As such, one probably | 282 // dumpTimers() dumps the global timer data. As such, one probably |
| 273 // wants to call mergeTimerStacks() as a prerequisite. | 283 // wants to call mergeTimerStacks() as a prerequisite. |
| 274 void dumpTimers(TimerStackIdT StackID = TSK_Default, | 284 void dumpTimers(TimerStackIdT StackID = TSK_Default, |
| 275 bool DumpCumulative = true); | 285 bool DumpCumulative = true); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 523 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
| 514 ~OstreamLocker() { Ctx->unlockStr(); } | 524 ~OstreamLocker() { Ctx->unlockStr(); } |
| 515 | 525 |
| 516 private: | 526 private: |
| 517 GlobalContext *const Ctx; | 527 GlobalContext *const Ctx; |
| 518 }; | 528 }; |
| 519 | 529 |
| 520 } // end of namespace Ice | 530 } // end of namespace Ice |
| 521 | 531 |
| 522 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 532 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| OLD | NEW |