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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 advanceForward(Iter); | 83 advanceForward(Iter); |
84 if (Iter == End) | 84 if (Iter == End) |
85 return nullptr; | 85 return nullptr; |
86 return Iter; | 86 return Iter; |
87 } | 87 } |
88 CfgNode *getNode() const { return Node; } | 88 CfgNode *getNode() const { return Node; } |
89 bool atEnd() const { return Cur == End; } | 89 bool atEnd() const { return Cur == End; } |
90 InstList::iterator getCur() const { return Cur; } | 90 InstList::iterator getCur() const { return Cur; } |
91 InstList::iterator getNext() const { return Next; } | 91 InstList::iterator getNext() const { return Next; } |
92 InstList::iterator getEnd() const { return End; } | 92 InstList::iterator getEnd() const { return End; } |
93 void insert(Inst *Inst); | 93 void insert(Inst *Instr); |
94 template <typename Inst, typename... Args> Inst *insert(Args &&... A) { | 94 template <typename Inst, typename... Args> Inst *insert(Args &&... A) { |
95 auto *New = Inst::create(Node->getCfg(), std::forward<Args>(A)...); | 95 auto *New = Inst::create(Node->getCfg(), std::forward<Args>(A)...); |
96 insert(New); | 96 insert(New); |
97 return New; | 97 return New; |
98 } | 98 } |
99 Inst *getLastInserted() const; | 99 Inst *getLastInserted() const; |
100 void advanceCur() { Cur = Next; } | 100 void advanceCur() { Cur = Next; } |
101 void advanceNext() { advanceForward(Next); } | 101 void advanceNext() { advanceForward(Next); } |
102 void setCur(InstList::iterator C) { Cur = C; } | 102 void setCur(InstList::iterator C) { Cur = C; } |
103 void setNext(InstList::iterator N) { Next = N; } | 103 void setNext(InstList::iterator N) { Next = N; } |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 }; | 358 }; |
359 | 359 |
360 explicit TargetLowering(Cfg *Func); | 360 explicit TargetLowering(Cfg *Func); |
361 // Applies command line filters to TypeToRegisterSet array. | 361 // Applies command line filters to TypeToRegisterSet array. |
362 static void | 362 static void |
363 filterTypeToRegisterSet(GlobalContext *Ctx, int32_t NumRegs, | 363 filterTypeToRegisterSet(GlobalContext *Ctx, int32_t NumRegs, |
364 llvm::SmallBitVector TypeToRegisterSet[], | 364 llvm::SmallBitVector TypeToRegisterSet[], |
365 size_t TypeToRegisterSetSize, | 365 size_t TypeToRegisterSetSize, |
366 std::function<IceString(int32_t)> getRegName, | 366 std::function<IceString(int32_t)> getRegName, |
367 std::function<IceString(RegClass)> getRegClassName); | 367 std::function<IceString(RegClass)> getRegClassName); |
368 virtual void lowerAlloca(const InstAlloca *Inst) = 0; | 368 virtual void lowerAlloca(const InstAlloca *Instr) = 0; |
369 virtual void lowerArithmetic(const InstArithmetic *Inst) = 0; | 369 virtual void lowerArithmetic(const InstArithmetic *Instr) = 0; |
370 virtual void lowerAssign(const InstAssign *Inst) = 0; | 370 virtual void lowerAssign(const InstAssign *Instr) = 0; |
371 virtual void lowerBr(const InstBr *Inst) = 0; | 371 virtual void lowerBr(const InstBr *Instr) = 0; |
372 virtual void lowerCall(const InstCall *Inst) = 0; | 372 virtual void lowerCall(const InstCall *Instr) = 0; |
373 virtual void lowerCast(const InstCast *Inst) = 0; | 373 virtual void lowerCast(const InstCast *Instr) = 0; |
374 virtual void lowerFcmp(const InstFcmp *Inst) = 0; | 374 virtual void lowerFcmp(const InstFcmp *Instr) = 0; |
375 virtual void lowerExtractElement(const InstExtractElement *Inst) = 0; | 375 virtual void lowerExtractElement(const InstExtractElement *Instr) = 0; |
376 virtual void lowerIcmp(const InstIcmp *Inst) = 0; | 376 virtual void lowerIcmp(const InstIcmp *Instr) = 0; |
377 virtual void lowerInsertElement(const InstInsertElement *Inst) = 0; | 377 virtual void lowerInsertElement(const InstInsertElement *Instr) = 0; |
378 virtual void lowerIntrinsicCall(const InstIntrinsicCall *Inst) = 0; | 378 virtual void lowerIntrinsicCall(const InstIntrinsicCall *Instr) = 0; |
379 virtual void lowerLoad(const InstLoad *Inst) = 0; | 379 virtual void lowerLoad(const InstLoad *Instr) = 0; |
380 virtual void lowerPhi(const InstPhi *Inst) = 0; | 380 virtual void lowerPhi(const InstPhi *Instr) = 0; |
381 virtual void lowerRet(const InstRet *Inst) = 0; | 381 virtual void lowerRet(const InstRet *Instr) = 0; |
382 virtual void lowerSelect(const InstSelect *Inst) = 0; | 382 virtual void lowerSelect(const InstSelect *Instr) = 0; |
383 virtual void lowerStore(const InstStore *Inst) = 0; | 383 virtual void lowerStore(const InstStore *Instr) = 0; |
384 virtual void lowerSwitch(const InstSwitch *Inst) = 0; | 384 virtual void lowerSwitch(const InstSwitch *Instr) = 0; |
385 virtual void lowerUnreachable(const InstUnreachable *Inst) = 0; | 385 virtual void lowerUnreachable(const InstUnreachable *Instr) = 0; |
386 virtual void lowerOther(const Inst *Instr); | 386 virtual void lowerOther(const Inst *Instr); |
387 | 387 |
388 virtual void genTargetHelperCallFor(Inst *Instr) = 0; | 388 virtual void genTargetHelperCallFor(Inst *Instr) = 0; |
389 virtual uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) = 0; | 389 virtual uint32_t getCallStackArgumentsSizeBytes(const InstCall *Instr) = 0; |
390 | 390 |
391 virtual void doAddressOptLoad() {} | 391 virtual void doAddressOptLoad() {} |
392 virtual void doAddressOptStore() {} | 392 virtual void doAddressOptStore() {} |
393 virtual void doMockBoundsCheck(Operand *) {} | 393 virtual void doMockBoundsCheck(Operand *) {} |
394 virtual void randomlyInsertNop(float Probability, | 394 virtual void randomlyInsertNop(float Probability, |
395 RandomNumberGenerator &RNG) = 0; | 395 RandomNumberGenerator &RNG) = 0; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 virtual void lower() {} | 568 virtual void lower() {} |
569 | 569 |
570 protected: | 570 protected: |
571 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 571 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
572 GlobalContext *Ctx; | 572 GlobalContext *Ctx; |
573 }; | 573 }; |
574 | 574 |
575 } // end of namespace Ice | 575 } // end of namespace Ice |
576 | 576 |
577 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 577 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |