| 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 // This file defines aspects of the compilation that persist across | 10 // This file defines aspects of the compilation that persist across |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 280 } |
| 281 | 281 |
| 282 Func->translate(); | 282 Func->translate(); |
| 283 EmitterWorkItem *Item = nullptr; | 283 EmitterWorkItem *Item = nullptr; |
| 284 if (Func->hasError()) { | 284 if (Func->hasError()) { |
| 285 getErrorStatus()->assign(EC_Translation); | 285 getErrorStatus()->assign(EC_Translation); |
| 286 OstreamLocker L(this); | 286 OstreamLocker L(this); |
| 287 getStrError() << "ICE translation error: " << Func->getFunctionName() | 287 getStrError() << "ICE translation error: " << Func->getFunctionName() |
| 288 << ": " << Func->getError() << "\n"; | 288 << ": " << Func->getError() << "\n"; |
| 289 Item = new EmitterWorkItem(Func->getSequenceNumber()); | 289 Item = new EmitterWorkItem(Func->getSequenceNumber()); |
| 290 Item->setGlobalInits(Func->getGlobalInits()); | |
| 291 } else { | 290 } else { |
| 292 Func->getAssembler<>()->setInternal(Func->getInternal()); | 291 Func->getAssembler<>()->setInternal(Func->getInternal()); |
| 293 switch (getFlags().getOutFileType()) { | 292 switch (getFlags().getOutFileType()) { |
| 294 case FT_Elf: | 293 case FT_Elf: |
| 295 case FT_Iasm: { | 294 case FT_Iasm: { |
| 296 Func->emitIAS(); | 295 Func->emitIAS(); |
| 297 // The Cfg has already emitted into the assembly buffer, so | 296 // The Cfg has already emitted into the assembly buffer, so |
| 298 // stats have been fully collected into this thread's TLS. | 297 // stats have been fully collected into this thread's TLS. |
| 299 // Dump them before TLS is reset for the next Cfg. | 298 // Dump them before TLS is reset for the next Cfg. |
| 300 dumpStats(Func->getFunctionName()); | 299 dumpStats(Func->getFunctionName()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 327 // __Sz_profile_summary function iterates over this array for printing the | 326 // __Sz_profile_summary function iterates over this array for printing the |
| 328 // profiling counters. | 327 // profiling counters. |
| 329 VariableDeclaration *blockProfileInfo(const VariableDeclarationList &Globals) { | 328 VariableDeclaration *blockProfileInfo(const VariableDeclarationList &Globals) { |
| 330 auto *Var = VariableDeclaration::create(); | 329 auto *Var = VariableDeclaration::create(); |
| 331 Var->setAlignment(typeWidthInBytes(IceType_i64)); | 330 Var->setAlignment(typeWidthInBytes(IceType_i64)); |
| 332 Var->setIsConstant(true); | 331 Var->setIsConstant(true); |
| 333 | 332 |
| 334 // Note: if you change this symbol, make sure to update | 333 // Note: if you change this symbol, make sure to update |
| 335 // runtime/szrt_profiler.c as well. | 334 // runtime/szrt_profiler.c as well. |
| 336 Var->setName("__Sz_block_profile_info"); | 335 Var->setName("__Sz_block_profile_info"); |
| 336 Var->setSuppressMangling(); |
| 337 Var->setLinkage(llvm::GlobalValue::ExternalLinkage); | 337 Var->setLinkage(llvm::GlobalValue::ExternalLinkage); |
| 338 for (const VariableDeclaration *Global : Globals) { | 338 for (const VariableDeclaration *Global : Globals) { |
| 339 if (Cfg::isProfileGlobal(*Global)) { | 339 if (Cfg::isProfileGlobal(*Global)) { |
| 340 constexpr RelocOffsetT BlockExecutionCounterOffset = 0; | 340 constexpr RelocOffsetT BlockExecutionCounterOffset = 0; |
| 341 Var->addInitializer(new VariableDeclaration::RelocInitializer( | 341 Var->addInitializer(new VariableDeclaration::RelocInitializer( |
| 342 Global, BlockExecutionCounterOffset)); | 342 Global, BlockExecutionCounterOffset)); |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 // This adds a 64-bit sentinel entry to the end of our array. For 32-bit | 346 // This adds a 64-bit sentinel entry to the end of our array. For 32-bit |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 Ctx = Func->getContext(); | 895 Ctx = Func->getContext(); |
| 896 Active = | 896 Active = |
| 897 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 897 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
| 898 if (Active) | 898 if (Active) |
| 899 Ctx->pushTimer(ID, StackID); | 899 Ctx->pushTimer(ID, StackID); |
| 900 } | 900 } |
| 901 | 901 |
| 902 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 902 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
| 903 | 903 |
| 904 } // end of namespace Ice | 904 } // end of namespace Ice |
| OLD | NEW |