OLD | NEW |
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 virtual void translateO0() { | 163 virtual void translateO0() { |
164 Func->setError("Target doesn't specify O0 lowering steps."); | 164 Func->setError("Target doesn't specify O0 lowering steps."); |
165 } | 165 } |
166 virtual void translateO1() { | 166 virtual void translateO1() { |
167 Func->setError("Target doesn't specify O1 lowering steps."); | 167 Func->setError("Target doesn't specify O1 lowering steps."); |
168 } | 168 } |
169 virtual void translateO2() { | 169 virtual void translateO2() { |
170 Func->setError("Target doesn't specify O2 lowering steps."); | 170 Func->setError("Target doesn't specify O2 lowering steps."); |
171 } | 171 } |
172 | 172 |
| 173 /// Generates calls to intrinsics for operations the Target can't handle. |
| 174 void genTargetHelperCalls(); |
173 /// Tries to do address mode optimization on a single instruction. | 175 /// Tries to do address mode optimization on a single instruction. |
174 void doAddressOpt(); | 176 void doAddressOpt(); |
175 /// Randomly insert NOPs. | 177 /// Randomly insert NOPs. |
176 void doNopInsertion(RandomNumberGenerator &RNG); | 178 void doNopInsertion(RandomNumberGenerator &RNG); |
177 /// Lowers a single non-Phi instruction. | 179 /// Lowers a single non-Phi instruction. |
178 void lower(); | 180 void lower(); |
179 /// Inserts and lowers a single high-level instruction at a specific insertion | 181 /// Inserts and lowers a single high-level instruction at a specific insertion |
180 /// point. | 182 /// point. |
181 void lowerInst(CfgNode *Node, InstList::iterator Next, InstHighLevel *Instr); | 183 void lowerInst(CfgNode *Node, InstList::iterator Next, InstHighLevel *Instr); |
182 /// Does preliminary lowering of the set of Phi instructions in the current | 184 /// Does preliminary lowering of the set of Phi instructions in the current |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 virtual void lowerIntrinsicCall(const InstIntrinsicCall *Inst) = 0; | 303 virtual void lowerIntrinsicCall(const InstIntrinsicCall *Inst) = 0; |
302 virtual void lowerLoad(const InstLoad *Inst) = 0; | 304 virtual void lowerLoad(const InstLoad *Inst) = 0; |
303 virtual void lowerPhi(const InstPhi *Inst) = 0; | 305 virtual void lowerPhi(const InstPhi *Inst) = 0; |
304 virtual void lowerRet(const InstRet *Inst) = 0; | 306 virtual void lowerRet(const InstRet *Inst) = 0; |
305 virtual void lowerSelect(const InstSelect *Inst) = 0; | 307 virtual void lowerSelect(const InstSelect *Inst) = 0; |
306 virtual void lowerStore(const InstStore *Inst) = 0; | 308 virtual void lowerStore(const InstStore *Inst) = 0; |
307 virtual void lowerSwitch(const InstSwitch *Inst) = 0; | 309 virtual void lowerSwitch(const InstSwitch *Inst) = 0; |
308 virtual void lowerUnreachable(const InstUnreachable *Inst) = 0; | 310 virtual void lowerUnreachable(const InstUnreachable *Inst) = 0; |
309 virtual void lowerOther(const Inst *Instr); | 311 virtual void lowerOther(const Inst *Instr); |
310 | 312 |
| 313 virtual void genTargetHelperCallFor(Inst *Instr) = 0; |
| 314 |
311 virtual void doAddressOptLoad() {} | 315 virtual void doAddressOptLoad() {} |
312 virtual void doAddressOptStore() {} | 316 virtual void doAddressOptStore() {} |
313 virtual void doMockBoundsCheck(Operand *) {} | 317 virtual void doMockBoundsCheck(Operand *) {} |
314 virtual void randomlyInsertNop(float Probability, | 318 virtual void randomlyInsertNop(float Probability, |
315 RandomNumberGenerator &RNG) = 0; | 319 RandomNumberGenerator &RNG) = 0; |
316 /// This gives the target an opportunity to post-process the lowered expansion | 320 /// This gives the target an opportunity to post-process the lowered expansion |
317 /// before returning. | 321 /// before returning. |
318 virtual void postLower() {} | 322 virtual void postLower() {} |
319 | 323 |
320 /// Find (non-SSA) instructions where the Dest variable appears in some source | 324 /// Find (non-SSA) instructions where the Dest variable appears in some source |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 virtual void lower() {} | 487 virtual void lower() {} |
484 | 488 |
485 protected: | 489 protected: |
486 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 490 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
487 GlobalContext *Ctx; | 491 GlobalContext *Ctx; |
488 }; | 492 }; |
489 | 493 |
490 } // end of namespace Ice | 494 } // end of namespace Ice |
491 | 495 |
492 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 496 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |