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

Side by Side Diff: src/IceTargetLowering.cpp

Issue 1419903002: Subzero: Refactor x86 register definitions to use the alias mechanism. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix assembler unit tests. Fix register names. Code review changes. Rebase Created 5 years, 1 month 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/IceRegistersX8664.h ('k') | src/IceTargetLoweringARM32.cpp » ('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 /// \file 10 /// \file
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return nullptr; 105 return nullptr;
106 } 106 }
107 107
108 TargetLowering::TargetLowering(Cfg *Func) 108 TargetLowering::TargetLowering(Cfg *Func)
109 : Func(Func), Ctx(Func->getContext()), Context() {} 109 : Func(Func), Ctx(Func->getContext()), Context() {}
110 110
111 std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target, 111 std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target,
112 Cfg *Func) { 112 Cfg *Func) {
113 #define SUBZERO_TARGET(X) \ 113 #define SUBZERO_TARGET(X) \
114 if (Target == Target_##X) \ 114 if (Target == Target_##X) \
115 return std::unique_ptr<Assembler>(new X::Assembler##X(Func->getContext())); 115 return std::unique_ptr<Assembler>(new X::Assembler##X());
116 #include "llvm/Config/SZTargets.def" 116 #include "llvm/Config/SZTargets.def"
117 117
118 Func->setError("Unsupported target assembler"); 118 Func->setError("Unsupported target assembler");
119 return nullptr; 119 return nullptr;
120 } 120 }
121 121
122 void TargetLowering::doAddressOpt() { 122 void TargetLowering::doAddressOpt() {
123 if (llvm::isa<InstLoad>(*Context.getCur())) 123 if (llvm::isa<InstLoad>(*Context.getCur()))
124 doAddressOptLoad(); 124 doAddressOptLoad();
125 else if (llvm::isa<InstStore>(*Context.getCur())) 125 else if (llvm::isa<InstStore>(*Context.getCur()))
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 453 }
454 if (UsesFramePointer) 454 if (UsesFramePointer)
455 Var->setStackOffset(-NextStackOffset); 455 Var->setStackOffset(-NextStackOffset);
456 else 456 else
457 Var->setStackOffset(SpillAreaSizeBytes - NextStackOffset); 457 Var->setStackOffset(SpillAreaSizeBytes - NextStackOffset);
458 } 458 }
459 } 459 }
460 460
461 InstCall *TargetLowering::makeHelperCall(const IceString &Name, Variable *Dest, 461 InstCall *TargetLowering::makeHelperCall(const IceString &Name, Variable *Dest,
462 SizeT MaxSrcs) { 462 SizeT MaxSrcs) {
463 const bool HasTailCall = false; 463 constexpr bool HasTailCall = false;
464 Constant *CallTarget = Ctx->getConstantExternSym(Name); 464 Constant *CallTarget = Ctx->getConstantExternSym(Name);
465 InstCall *Call = 465 InstCall *Call =
466 InstCall::create(Func, MaxSrcs, Dest, CallTarget, HasTailCall); 466 InstCall::create(Func, MaxSrcs, Dest, CallTarget, HasTailCall);
467 return Call; 467 return Call;
468 } 468 }
469 469
470 bool TargetLowering::shouldOptimizeMemIntrins() { 470 bool TargetLowering::shouldOptimizeMemIntrins() {
471 return Ctx->getFlags().getOptLevel() >= Opt_1 || 471 return Ctx->getFlags().getOptLevel() >= Opt_1 ||
472 Ctx->getFlags().getForceMemIntrinOpt(); 472 Ctx->getFlags().getForceMemIntrinOpt();
473 } 473 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 if (Target == Target_##X) \ 625 if (Target == Target_##X) \
626 return TargetHeader##X::create(Ctx); 626 return TargetHeader##X::create(Ctx);
627 #include "llvm/Config/SZTargets.def" 627 #include "llvm/Config/SZTargets.def"
628 628
629 llvm::report_fatal_error("Unsupported target header lowering"); 629 llvm::report_fatal_error("Unsupported target header lowering");
630 } 630 }
631 631
632 TargetHeaderLowering::~TargetHeaderLowering() = default; 632 TargetHeaderLowering::~TargetHeaderLowering() = default;
633 633
634 } // end of namespace Ice 634 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceRegistersX8664.h ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698