| OLD | NEW |
| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 TargetLowering::AutoBundle::~AutoBundle() { | 302 TargetLowering::AutoBundle::~AutoBundle() { |
| 303 assert(Target->AutoBundling); | 303 assert(Target->AutoBundling); |
| 304 Target->AutoBundling = false; | 304 Target->AutoBundling = false; |
| 305 if (NeedSandboxing) { | 305 if (NeedSandboxing) { |
| 306 Target->_bundle_unlock(); | 306 Target->_bundle_unlock(); |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 void TargetLowering::genTargetHelperCalls() { | 310 void TargetLowering::genTargetHelperCalls() { |
| 311 Utils::BoolFlagSaver _(GeneratingTargetHelpers, true); |
| 311 for (CfgNode *Node : Func->getNodes()) { | 312 for (CfgNode *Node : Func->getNodes()) { |
| 312 Context.init(Node); | 313 Context.init(Node); |
| 313 while (!Context.atEnd()) { | 314 while (!Context.atEnd()) { |
| 314 PostIncrLoweringContext _(Context); | 315 PostIncrLoweringContext _(Context); |
| 315 genTargetHelperCallFor(Context.getCur()); | 316 genTargetHelperCallFor(Context.getCur()); |
| 316 } | 317 } |
| 317 } | 318 } |
| 318 } | 319 } |
| 319 | 320 |
| 320 void TargetLowering::doAddressOpt() { | 321 void TargetLowering::doAddressOpt() { |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 | 700 |
| 700 bool TargetLowering::shouldOptimizeMemIntrins() { | 701 bool TargetLowering::shouldOptimizeMemIntrins() { |
| 701 return Ctx->getFlags().getOptLevel() >= Opt_1 || | 702 return Ctx->getFlags().getOptLevel() >= Opt_1 || |
| 702 Ctx->getFlags().getForceMemIntrinOpt(); | 703 Ctx->getFlags().getForceMemIntrinOpt(); |
| 703 } | 704 } |
| 704 | 705 |
| 705 void TargetLowering::scalarizeArithmetic(InstArithmetic::OpKind Kind, | 706 void TargetLowering::scalarizeArithmetic(InstArithmetic::OpKind Kind, |
| 706 Variable *Dest, Operand *Src0, | 707 Variable *Dest, Operand *Src0, |
| 707 Operand *Src1) { | 708 Operand *Src1) { |
| 708 scalarizeInstruction( | 709 scalarizeInstruction( |
| 709 Dest, Src0, Src1, | 710 Dest, [this, Kind](Variable *Dest, Operand *Src0, Operand *Src1) { |
| 710 [this, Kind](Variable *Dest, Variable *Src0, Variable *Src1) { | |
| 711 return Context.insert<InstArithmetic>(Kind, Dest, Src0, Src1); | 711 return Context.insert<InstArithmetic>(Kind, Dest, Src0, Src1); |
| 712 }); | 712 }, Src0, Src1); |
| 713 } | 713 } |
| 714 | 714 |
| 715 void TargetLowering::emitWithoutPrefix(const ConstantRelocatable *C, | 715 void TargetLowering::emitWithoutPrefix(const ConstantRelocatable *C, |
| 716 const char *Suffix) const { | 716 const char *Suffix) const { |
| 717 if (!BuildDefs::dump()) | 717 if (!BuildDefs::dump()) |
| 718 return; | 718 return; |
| 719 Ostream &Str = Ctx->getStrEmit(); | 719 Ostream &Str = Ctx->getStrEmit(); |
| 720 const IceString &EmitStr = C->getEmitString(); | 720 const IceString &EmitStr = C->getEmitString(); |
| 721 if (!EmitStr.empty()) { | 721 if (!EmitStr.empty()) { |
| 722 // C has a custom emit string, so we use it instead of the canonical | 722 // C has a custom emit string, so we use it instead of the canonical |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 case Target_##X: \ | 875 case Target_##X: \ |
| 876 return ::X::createTargetHeaderLowering(Ctx); | 876 return ::X::createTargetHeaderLowering(Ctx); |
| 877 #include "llvm/Config/SZTargets.def" | 877 #include "llvm/Config/SZTargets.def" |
| 878 #undef SUBZERO_TARGET | 878 #undef SUBZERO_TARGET |
| 879 } | 879 } |
| 880 } | 880 } |
| 881 | 881 |
| 882 TargetHeaderLowering::~TargetHeaderLowering() = default; | 882 TargetHeaderLowering::~TargetHeaderLowering() = default; |
| 883 | 883 |
| 884 } // end of namespace Ice | 884 } // end of namespace Ice |
| OLD | NEW |