OLD | NEW |
1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// | 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// |
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 /// \file | 10 /// \file |
11 /// \brief Defines aspects of the compilation that persist across multiple | 11 /// \brief Defines aspects of the compilation that persist across multiple |
12 /// functions. | 12 /// functions. |
13 /// | 13 /// |
14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
15 | 15 |
16 #include "IceGlobalContext.h" | 16 #include "IceGlobalContext.h" |
17 | 17 |
18 #include "IceCfg.h" | 18 #include "IceCfg.h" |
19 #include "IceCfgNode.h" | 19 #include "IceCfgNode.h" |
20 #include "IceClFlags.h" | 20 #include "IceClFlags.h" |
21 #include "IceDefs.h" | 21 #include "IceDefs.h" |
22 #include "IceELFObjectWriter.h" | 22 #include "IceELFObjectWriter.h" |
23 #include "IceGlobalInits.h" | 23 #include "IceGlobalInits.h" |
| 24 #include "IceLiveness.h" |
24 #include "IceOperand.h" | 25 #include "IceOperand.h" |
25 #include "IceTargetLowering.h" | 26 #include "IceTargetLowering.h" |
26 #include "IceTimerTree.h" | 27 #include "IceTimerTree.h" |
27 #include "IceTypes.def" | 28 #include "IceTypes.def" |
28 #include "IceTypes.h" | 29 #include "IceTypes.h" |
29 | 30 |
30 #ifdef __clang__ | 31 #ifdef __clang__ |
31 #pragma clang diagnostic push | 32 #pragma clang diagnostic push |
32 #pragma clang diagnostic ignored "-Wunused-parameter" | 33 #pragma clang diagnostic ignored "-Wunused-parameter" |
33 #endif // __clang__ | 34 #endif // __clang__ |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 DataLowering(TargetDataLowering::createLowering(this)) { | 298 DataLowering(TargetDataLowering::createLowering(this)) { |
298 assert(OsDump && "OsDump is not defined for GlobalContext"); | 299 assert(OsDump && "OsDump is not defined for GlobalContext"); |
299 assert(OsEmit && "OsEmit is not defined for GlobalContext"); | 300 assert(OsEmit && "OsEmit is not defined for GlobalContext"); |
300 assert(OsError && "OsError is not defined for GlobalContext"); | 301 assert(OsError && "OsError is not defined for GlobalContext"); |
301 // Make sure thread_local fields are properly initialized before any | 302 // Make sure thread_local fields are properly initialized before any |
302 // accesses are made. Do this here instead of at the start of | 303 // accesses are made. Do this here instead of at the start of |
303 // main() so that all clients (e.g. unit tests) can benefit for | 304 // main() so that all clients (e.g. unit tests) can benefit for |
304 // free. | 305 // free. |
305 GlobalContext::TlsInit(); | 306 GlobalContext::TlsInit(); |
306 Cfg::TlsInit(); | 307 Cfg::TlsInit(); |
| 308 Liveness::TlsInit(); |
307 // Create a new ThreadContext for the current thread. No need to | 309 // Create a new ThreadContext for the current thread. No need to |
308 // lock AllThreadContexts at this point since no other threads have | 310 // lock AllThreadContexts at this point since no other threads have |
309 // access yet to this GlobalContext object. | 311 // access yet to this GlobalContext object. |
310 ThreadContext *MyTLS = new ThreadContext(); | 312 ThreadContext *MyTLS = new ThreadContext(); |
311 AllThreadContexts.push_back(MyTLS); | 313 AllThreadContexts.push_back(MyTLS); |
312 ICE_TLS_SET_FIELD(TLS, MyTLS); | 314 ICE_TLS_SET_FIELD(TLS, MyTLS); |
313 // Pre-register built-in stack names. | 315 // Pre-register built-in stack names. |
314 if (BuildDefs::timers()) { | 316 if (BuildDefs::timers()) { |
315 // TODO(stichnot): There needs to be a strong relationship between | 317 // TODO(stichnot): There needs to be a strong relationship between |
316 // the newTimerStackID() return values and TSK_Default/TSK_Funcs. | 318 // the newTimerStackID() return values and TSK_Default/TSK_Funcs. |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 Ctx = Func->getContext(); | 1005 Ctx = Func->getContext(); |
1004 Active = | 1006 Active = |
1005 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 1007 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
1006 if (Active) | 1008 if (Active) |
1007 Ctx->pushTimer(ID, StackID); | 1009 Ctx->pushTimer(ID, StackID); |
1008 } | 1010 } |
1009 | 1011 |
1010 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 1012 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
1011 | 1013 |
1012 } // end of namespace Ice | 1014 } // end of namespace Ice |
OLD | NEW |