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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 | 699 |
700 bool TargetLowering::shouldOptimizeMemIntrins() { | 700 bool TargetLowering::shouldOptimizeMemIntrins() { |
701 return Ctx->getFlags().getOptLevel() >= Opt_1 || | 701 return Ctx->getFlags().getOptLevel() >= Opt_1 || |
702 Ctx->getFlags().getForceMemIntrinOpt(); | 702 Ctx->getFlags().getForceMemIntrinOpt(); |
703 } | 703 } |
704 | 704 |
705 void TargetLowering::scalarizeArithmetic(InstArithmetic::OpKind Kind, | 705 void TargetLowering::scalarizeArithmetic(InstArithmetic::OpKind Kind, |
706 Variable *Dest, Operand *Src0, | 706 Variable *Dest, Operand *Src0, |
707 Operand *Src1) { | 707 Operand *Src1) { |
708 scalarizeInstruction( | 708 scalarizeInstruction( |
709 Dest, Src0, Src1, | 709 Dest, [this, Kind](Variable *Dest, Variable *Src0, Variable *Src1) { |
710 [this, Kind](Variable *Dest, Variable *Src0, Variable *Src1) { | |
711 return Context.insert<InstArithmetic>(Kind, Dest, Src0, Src1); | 710 return Context.insert<InstArithmetic>(Kind, Dest, Src0, Src1); |
712 }); | 711 }, Src0, Src1); |
713 } | 712 } |
714 | 713 |
715 void TargetLowering::emitWithoutPrefix(const ConstantRelocatable *C, | 714 void TargetLowering::emitWithoutPrefix(const ConstantRelocatable *C, |
716 const char *Suffix) const { | 715 const char *Suffix) const { |
717 if (!BuildDefs::dump()) | 716 if (!BuildDefs::dump()) |
718 return; | 717 return; |
719 Ostream &Str = Ctx->getStrEmit(); | 718 Ostream &Str = Ctx->getStrEmit(); |
720 const IceString &EmitStr = C->getEmitString(); | 719 const IceString &EmitStr = C->getEmitString(); |
721 if (!EmitStr.empty()) { | 720 if (!EmitStr.empty()) { |
722 // C has a custom emit string, so we use it instead of the canonical | 721 // 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: \ | 874 case Target_##X: \ |
876 return ::X::createTargetHeaderLowering(Ctx); | 875 return ::X::createTargetHeaderLowering(Ctx); |
877 #include "llvm/Config/SZTargets.def" | 876 #include "llvm/Config/SZTargets.def" |
878 #undef SUBZERO_TARGET | 877 #undef SUBZERO_TARGET |
879 } | 878 } |
880 } | 879 } |
881 | 880 |
882 TargetHeaderLowering::~TargetHeaderLowering() = default; | 881 TargetHeaderLowering::~TargetHeaderLowering() = default; |
883 | 882 |
884 } // end of namespace Ice | 883 } // end of namespace Ice |
OLD | NEW |