Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: src/IceGlobalContext.cpp

Issue 1180883002: Subzero: Fix lit and cross tests broken in f8b4cc8. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pydir/crosstest.py ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « pydir/crosstest.py ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698