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

Side by Side Diff: src/IceTargetLowering.cpp

Issue 1127963004: Subzero ARM: lowerArguments (GPR), basic legalize(), and lowerRet(i32, i64). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fix warnings, etc Created 5 years, 7 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 | « src/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.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/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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 RegSetMask RegExclude = RegSet_None; 218 RegSetMask RegExclude = RegSet_None;
219 RegInclude |= RegSet_CallerSave; 219 RegInclude |= RegSet_CallerSave;
220 RegInclude |= RegSet_CalleeSave; 220 RegInclude |= RegSet_CalleeSave;
221 if (hasFramePointer()) 221 if (hasFramePointer())
222 RegExclude |= RegSet_FramePointer; 222 RegExclude |= RegSet_FramePointer;
223 LinearScan.init(Kind); 223 LinearScan.init(Kind);
224 llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude); 224 llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude);
225 LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc()); 225 LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
226 } 226 }
227 227
228 void TargetLowering::inferTwoAddress() {
229 // Find two-address non-SSA instructions where Dest==Src0, and set
230 // the DestNonKillable flag to keep liveness analysis consistent.
231 for (auto Inst = Context.getCur(), E = Context.getNext(); Inst != E; ++Inst) {
232 if (Inst->isDeleted())
233 continue;
234 if (Variable *Dest = Inst->getDest()) {
235 // TODO(stichnot): We may need to consider all source
236 // operands, not just the first one, if using 3-address
237 // instructions.
238 if (Inst->getSrcSize() > 0 && Inst->getSrc(0) == Dest)
239 Inst->setDestNonKillable();
240 }
241 }
242 }
243
228 InstCall *TargetLowering::makeHelperCall(const IceString &Name, Variable *Dest, 244 InstCall *TargetLowering::makeHelperCall(const IceString &Name, Variable *Dest,
229 SizeT MaxSrcs) { 245 SizeT MaxSrcs) {
230 const bool HasTailCall = false; 246 const bool HasTailCall = false;
231 Constant *CallTarget = Ctx->getConstantExternSym(Name); 247 Constant *CallTarget = Ctx->getConstantExternSym(Name);
232 InstCall *Call = 248 InstCall *Call =
233 InstCall::create(Func, MaxSrcs, Dest, CallTarget, HasTailCall); 249 InstCall::create(Func, MaxSrcs, Dest, CallTarget, HasTailCall);
234 return Call; 250 return Call;
235 } 251 }
236 252
237 void TargetLowering::emitWithoutPrefix(const ConstantRelocatable *C) const { 253 void TargetLowering::emitWithoutPrefix(const ConstantRelocatable *C) const {
(...skipping 28 matching lines...) Expand all
266 return std::unique_ptr<TargetDataLowering>(TargetData##X::create(Ctx)); 282 return std::unique_ptr<TargetDataLowering>(TargetData##X::create(Ctx));
267 #include "llvm/Config/SZTargets.def" 283 #include "llvm/Config/SZTargets.def"
268 284
269 llvm_unreachable("Unsupported target data lowering"); 285 llvm_unreachable("Unsupported target data lowering");
270 return nullptr; 286 return nullptr;
271 } 287 }
272 288
273 TargetDataLowering::~TargetDataLowering() {} 289 TargetDataLowering::~TargetDataLowering() {}
274 290
275 } // end of namespace Ice 291 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698