OLD | NEW |
1 //===- subzero/src/IceInstX86BaseImpl.h - Generic X86 instructions -*- C++ -*=// | 1 //===- subzero/src/IceInstX86BaseImpl.h - Generic X86 instructions -*- C++ -*=// |
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 template <typename TraitsType> | 93 template <typename TraitsType> |
94 InstImpl<TraitsType>::InstX86Label::InstX86Label(Cfg *Func, | 94 InstImpl<TraitsType>::InstX86Label::InstX86Label(Cfg *Func, |
95 TargetLowering *Target) | 95 TargetLowering *Target) |
96 : InstX86Base(Func, InstX86Base::Label, 0, nullptr), | 96 : InstX86Base(Func, InstX86Base::Label, 0, nullptr), |
97 Number(Target->makeNextLabelNumber()) {} | 97 Number(Target->makeNextLabelNumber()) {} |
98 | 98 |
99 template <typename TraitsType> | 99 template <typename TraitsType> |
100 IceString InstImpl<TraitsType>::InstX86Label::getName(const Cfg *Func) const { | 100 IceString InstImpl<TraitsType>::InstX86Label::getName(const Cfg *Func) const { |
| 101 // TODO(stichnot): Returning an empty string in a non-DUMP build can cause a |
| 102 // huge degradation in ConstantRelocatable hashing. Investigate and fix, but |
| 103 // for now return something reasonably unique. |
101 if (!BuildDefs::dump()) | 104 if (!BuildDefs::dump()) |
102 return IceString(); | 105 return Func->getFunctionName() + std::to_string(Number); |
103 return ".L" + Func->getFunctionName() + "$local$__" + std::to_string(Number); | 106 return ".L" + Func->getFunctionName() + "$local$__" + std::to_string(Number); |
104 } | 107 } |
105 | 108 |
106 template <typename TraitsType> | 109 template <typename TraitsType> |
107 InstImpl<TraitsType>::InstX86Br::InstX86Br( | 110 InstImpl<TraitsType>::InstX86Br::InstX86Br( |
108 Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, | 111 Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, |
109 const InstImpl<TraitsType>::InstX86Label *Label, BrCond Condition, | 112 const InstImpl<TraitsType>::InstX86Label *Label, BrCond Condition, |
110 Mode Kind) | 113 Mode Kind) |
111 : InstX86Base(Func, InstX86Base::Br, 0, nullptr), Condition(Condition), | 114 : InstX86Base(Func, InstX86Base::Br, 0, nullptr), Condition(Condition), |
112 TargetTrue(TargetTrue), TargetFalse(TargetFalse), Label(Label), | 115 TargetTrue(TargetTrue), TargetFalse(TargetFalse), Label(Label), |
(...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2890 return; | 2893 return; |
2891 Ostream &Str = Func->getContext()->getStrDump(); | 2894 Ostream &Str = Func->getContext()->getStrDump(); |
2892 Str << "IACA_END"; | 2895 Str << "IACA_END"; |
2893 } | 2896 } |
2894 | 2897 |
2895 } // end of namespace X86NAMESPACE | 2898 } // end of namespace X86NAMESPACE |
2896 | 2899 |
2897 } // end of namespace Ice | 2900 } // end of namespace Ice |
2898 | 2901 |
2899 #endif // SUBZERO_SRC_ICEINSTX86BASEIMPL_H | 2902 #endif // SUBZERO_SRC_ICEINSTX86BASEIMPL_H |
OLD | NEW |