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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 2099293002: Subzero: Make -translate-only work with nonzero -threads=<N>. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | 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 /// \file 10 /// \file
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 getConstantExternSym(getGlobalString(Name)); 355 getConstantExternSym(getGlobalString(Name));
356 RUNTIME_HELPER_FUNCTIONS_TABLE 356 RUNTIME_HELPER_FUNCTIONS_TABLE
357 #undef X 357 #undef X
358 358
359 TargetLowering::staticInit(this); 359 TargetLowering::staticInit(this);
360 } 360 }
361 361
362 void GlobalContext::translateFunctions() { 362 void GlobalContext::translateFunctions() {
363 TimerMarker Timer(TimerStack::TT_translateFunctions, this); 363 TimerMarker Timer(TimerStack::TT_translateFunctions, this);
364 while (std::unique_ptr<OptWorkItem> OptItem = optQueueBlockingPop()) { 364 while (std::unique_ptr<OptWorkItem> OptItem = optQueueBlockingPop()) {
365 std::unique_ptr<EmitterWorkItem> Item;
365 auto Func = OptItem->getParsedCfg(); 366 auto Func = OptItem->getParsedCfg();
366 // Install Func in TLS for Cfg-specific container allocators. 367 // Install Func in TLS for Cfg-specific container allocators.
367 CfgLocalAllocatorScope _(Func.get()); 368 CfgLocalAllocatorScope _(Func.get());
368 // Reset per-function stats being accumulated in TLS. 369 // Reset per-function stats being accumulated in TLS.
369 resetStats(); 370 resetStats();
370 // Set verbose level to none if the current function does NOT match the 371 // Set verbose level to none if the current function does NOT match the
371 // -verbose-focus command-line option. 372 // -verbose-focus command-line option.
372 if (!getFlags().matchVerboseFocusOn(Func->getFunctionName(), 373 if (!getFlags().matchVerboseFocusOn(Func->getFunctionName(),
373 Func->getSequenceNumber())) 374 Func->getSequenceNumber()))
374 Func->setVerbose(IceV_None); 375 Func->setVerbose(IceV_None);
375 // Disable translation if -notranslate is specified, or if the current 376 // Disable translation if -notranslate is specified, or if the current
376 // function matches the -translate-only option. If translation is disabled, 377 // function matches the -translate-only option. If translation is disabled,
377 // just dump the high-level IR and continue. 378 // just dump the high-level IR and continue.
378 if (getFlags().getDisableTranslation() || 379 if (getFlags().getDisableTranslation() ||
379 !getFlags().matchTranslateOnly(Func->getFunctionName(), 380 !getFlags().matchTranslateOnly(Func->getFunctionName(),
380 Func->getSequenceNumber())) { 381 Func->getSequenceNumber())) {
381 Func->dump(); 382 Func->dump();
383 // Add a dummy work item as a placeholder. This maintains sequence
384 // numbers so that the emitter thread will emit subsequent functions.
385 Item = makeUnique<EmitterWorkItem>(Func->getSequenceNumber());
386 emitQueueBlockingPush(std::move(Item));
382 continue; // Func goes out of scope and gets deleted 387 continue; // Func goes out of scope and gets deleted
383 } 388 }
384 389
385 Func->translate(); 390 Func->translate();
386 std::unique_ptr<EmitterWorkItem> Item;
387 if (Func->hasError()) { 391 if (Func->hasError()) {
388 getErrorStatus()->assign(EC_Translation); 392 getErrorStatus()->assign(EC_Translation);
389 OstreamLocker L(this); 393 OstreamLocker L(this);
390 getStrError() << "ICE translation error: " << Func->getFunctionName() 394 getStrError() << "ICE translation error: " << Func->getFunctionName()
391 << ": " << Func->getError() << ": " 395 << ": " << Func->getError() << ": "
392 << Func->getFunctionNameAndSize() << "\n"; 396 << Func->getFunctionNameAndSize() << "\n";
393 Item = makeUnique<EmitterWorkItem>(Func->getSequenceNumber()); 397 Item = makeUnique<EmitterWorkItem>(Func->getSequenceNumber());
394 } else { 398 } else {
395 Func->getAssembler<>()->setInternal(Func->getInternal()); 399 Func->getAssembler<>()->setInternal(Func->getInternal());
396 switch (getFlags().getOutFileType()) { 400 switch (getFlags().getOutFileType()) {
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 void TimerMarker::pushCfg(const Cfg *Func) { 1041 void TimerMarker::pushCfg(const Cfg *Func) {
1038 Ctx = Func->getContext(); 1042 Ctx = Func->getContext();
1039 Active = Func->getFocusedTiming() || getFlags().getSubzeroTimingEnabled(); 1043 Active = Func->getFocusedTiming() || getFlags().getSubzeroTimingEnabled();
1040 if (Active) 1044 if (Active)
1041 Ctx->pushTimer(ID, StackID); 1045 Ctx->pushTimer(ID, StackID);
1042 } 1046 }
1043 1047
1044 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); 1048 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
1045 1049
1046 } // end of namespace Ice 1050 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698