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

Side by Side Diff: src/IceTargetLowering.cpp

Issue 870653002: Subzero: Initial implementation of multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 5 years, 11 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
OLDNEW
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===//
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 implements the skeleton of the TargetLowering class, 10 // This file implements the skeleton of the TargetLowering class,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return IceTargetX8664::create(Func); 94 return IceTargetX8664::create(Func);
95 if (Target == Target_ARM32) 95 if (Target == Target_ARM32)
96 return IceTargetARM32::create(Func); 96 return IceTargetARM32::create(Func);
97 if (Target == Target_ARM64) 97 if (Target == Target_ARM64)
98 return IceTargetARM64::create(Func); 98 return IceTargetARM64::create(Func);
99 #endif 99 #endif
100 Func->setError("Unsupported target"); 100 Func->setError("Unsupported target");
101 return nullptr; 101 return nullptr;
102 } 102 }
103 103
104 void TargetLowering::emitConstants(GlobalContext *Ctx) {
105 // Wait for the worker threads to finish so that we know nothing
106 // more will be added to the constant pool.
107 Ctx->waitForWorkerThreads();
JF 2015/01/22 20:50:56 It seems somewhat obscure to have emitConstants be
jvoung (off chromium) 2015/01/22 23:06:06 Looks like it should have already been done before
Jim Stichnoth 2015/01/23 07:55:55 Done, in main(), so that startWorkerThreads() and
Jim Stichnoth 2015/01/23 07:55:55 Done.
108 if (Ctx->getFlags().DisableTranslation)
109 return;
110 TargetArch Target = Ctx->getTargetArch();
111 if (Target == Target_X8632) {
112 TargetX8632::emitConstants(Ctx);
113 return;
114 }
115 #if 0
116 if (Target == Target_X8664) {
117 IceTargetX8664::emitConstants(Ctx);
118 return;
119 }
120 if (Target == Target_ARM32) {
121 IceTargetARM32::emitConstants(Ctx);
122 return;
123 }
124 if (Target == Target_ARM64) {
125 IceTargetARM64::emitConstants(Ctx);
126 return;
127 }
128 #endif
129 llvm_unreachable("emitConstants: Unsupported target");
130 }
131
104 TargetLowering::TargetLowering(Cfg *Func) 132 TargetLowering::TargetLowering(Cfg *Func)
105 : Func(Func), Ctx(Func->getContext()), 133 : Func(Func), Ctx(Func->getContext()),
106 RandomizeRegisterAllocation(CLRandomizeRegisterAllocation), 134 RandomizeRegisterAllocation(CLRandomizeRegisterAllocation),
107 HasComputedFrame(false), CallsReturnsTwice(false), StackAdjustment(0), 135 HasComputedFrame(false), CallsReturnsTwice(false), StackAdjustment(0),
108 Context() {} 136 Context() {}
109 137
110 std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target, 138 std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target,
111 Cfg *Func) { 139 Cfg *Func) {
112 // These statements can be #ifdef'd to specialize the assembler 140 // These statements can be #ifdef'd to specialize the assembler
113 // to a subset of the available targets. TODO: use CRTP. 141 // to a subset of the available targets. TODO: use CRTP.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (Target == Target_ARM64) 295 if (Target == Target_ARM64)
268 return IceTargetGlobalInitARM64::create(Ctx); 296 return IceTargetGlobalInitARM64::create(Ctx);
269 #endif 297 #endif
270 llvm_unreachable("Unsupported target"); 298 llvm_unreachable("Unsupported target");
271 return nullptr; 299 return nullptr;
272 } 300 }
273 301
274 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} 302 TargetGlobalInitLowering::~TargetGlobalInitLowering() {}
275 303
276 } // end of namespace Ice 304 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698