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 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
479 | 479 |
480 saveBlockInfoPtrs(); | 480 saveBlockInfoPtrs(); |
481 // If we need to shuffle the layout of global variables, shuffle them now. | 481 // If we need to shuffle the layout of global variables, shuffle them now. |
482 if (getFlags().getReorderGlobalVariables()) { | 482 if (getFlags().getReorderGlobalVariables()) { |
483 // Create a random number generator for global variable reordering. | 483 // Create a random number generator for global variable reordering. |
484 RandomNumberGenerator RNG(getFlags().getRandomSeed(), | 484 RandomNumberGenerator RNG(getFlags().getRandomSeed(), |
485 RPE_GlobalVariableReordering); | 485 RPE_GlobalVariableReordering); |
486 RandomShuffle(Globals.begin(), Globals.end(), | 486 RandomShuffle(Globals.begin(), Globals.end(), |
487 [&RNG](int N) { return (uint32_t)RNG.next(N); }); | 487 [&RNG](int N) { return (uint32_t)RNG.next(N); }); |
488 } | 488 } |
489 | |
490 if (Instrumentor) | |
Karl
2016/06/06 22:27:02
Again, enclose code inside a conditional on BuildD
tlively
2016/06/07 00:43:05
Done.
| |
491 Instrumentor->instrumentGlobals(); | |
492 | |
489 DataLowering->lowerGlobals(Globals, SectionSuffix); | 493 DataLowering->lowerGlobals(Globals, SectionSuffix); |
490 if (ProfileBlockInfos.empty() && DisposeGlobalVariablesAfterLowering) { | 494 if (ProfileBlockInfos.empty() && DisposeGlobalVariablesAfterLowering) { |
491 Globals.clearAndPurge(); | 495 Globals.clearAndPurge(); |
492 } else { | 496 } else { |
493 Globals.clear(); | 497 Globals.clear(); |
494 } | 498 } |
495 } | 499 } |
496 | 500 |
497 void GlobalContext::lowerProfileData() { | 501 void GlobalContext::lowerProfileData() { |
498 // ProfileBlockInfoVarDecl is initialized in the constructor, and will only | 502 // ProfileBlockInfoVarDecl is initialized in the constructor, and will only |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1033 void TimerMarker::pushCfg(const Cfg *Func) { | 1037 void TimerMarker::pushCfg(const Cfg *Func) { |
1034 Ctx = Func->getContext(); | 1038 Ctx = Func->getContext(); |
1035 Active = Func->getFocusedTiming() || getFlags().getSubzeroTimingEnabled(); | 1039 Active = Func->getFocusedTiming() || getFlags().getSubzeroTimingEnabled(); |
1036 if (Active) | 1040 if (Active) |
1037 Ctx->pushTimer(ID, StackID); | 1041 Ctx->pushTimer(ID, StackID); |
1038 } | 1042 } |
1039 | 1043 |
1040 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 1044 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
1041 | 1045 |
1042 } // end of namespace Ice | 1046 } // end of namespace Ice |
OLD | NEW |