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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 ::X::staticInit(Flags); \ | 145 ::X::staticInit(Flags); \ |
146 } break; | 146 } break; |
147 #include "llvm/Config/SZTargets.def" | 147 #include "llvm/Config/SZTargets.def" |
148 #undef SUBZERO_TARGET | 148 #undef SUBZERO_TARGET |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 TargetLowering::TargetLowering(Cfg *Func) | 152 TargetLowering::TargetLowering(Cfg *Func) |
153 : Func(Func), Ctx(Func->getContext()), Context() {} | 153 : Func(Func), Ctx(Func->getContext()), Context() {} |
154 | 154 |
| 155 TargetLowering::AutoBundle::AutoBundle(TargetLowering *Target, |
| 156 InstBundleLock::Option Option) |
| 157 : Target(Target), |
| 158 NeedSandboxing(Target->Ctx->getFlags().getUseSandboxing()) { |
| 159 assert(!Target->AutoBundling); |
| 160 Target->AutoBundling = true; |
| 161 if (NeedSandboxing) { |
| 162 Target->_bundle_lock(Option); |
| 163 } |
| 164 } |
| 165 |
| 166 TargetLowering::AutoBundle::~AutoBundle() { |
| 167 assert(Target->AutoBundling); |
| 168 Target->AutoBundling = false; |
| 169 if (NeedSandboxing) { |
| 170 Target->_bundle_unlock(); |
| 171 } |
| 172 } |
| 173 |
155 void TargetLowering::genTargetHelperCalls() { | 174 void TargetLowering::genTargetHelperCalls() { |
156 for (CfgNode *Node : Func->getNodes()) { | 175 for (CfgNode *Node : Func->getNodes()) { |
157 Context.init(Node); | 176 Context.init(Node); |
158 while (!Context.atEnd()) { | 177 while (!Context.atEnd()) { |
159 PostIncrLoweringContext _(Context); | 178 PostIncrLoweringContext _(Context); |
160 genTargetHelperCallFor(Context.getCur()); | 179 genTargetHelperCallFor(Context.getCur()); |
161 } | 180 } |
162 } | 181 } |
163 } | 182 } |
164 | 183 |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 case Target_##X: \ | 701 case Target_##X: \ |
683 return ::X::createTargetHeaderLowering(Ctx); | 702 return ::X::createTargetHeaderLowering(Ctx); |
684 #include "llvm/Config/SZTargets.def" | 703 #include "llvm/Config/SZTargets.def" |
685 #undef SUBZERO_TARGET | 704 #undef SUBZERO_TARGET |
686 } | 705 } |
687 } | 706 } |
688 | 707 |
689 TargetHeaderLowering::~TargetHeaderLowering() = default; | 708 TargetHeaderLowering::~TargetHeaderLowering() = default; |
690 | 709 |
691 } // end of namespace Ice | 710 } // end of namespace Ice |
OLD | NEW |