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