OLD | NEW |
1 //===- subzero/src/IceInst.h - High-level instructions ----------*- C++ -*-===// | 1 //===- subzero/src/IceInst.h - High-level 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 // This file declares the Inst class and its target-independent | 10 // This file declares the Inst class and its target-independent |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 class InstPhi : public InstHighLevel { | 547 class InstPhi : public InstHighLevel { |
548 InstPhi(const InstPhi &) = delete; | 548 InstPhi(const InstPhi &) = delete; |
549 InstPhi &operator=(const InstPhi &) = delete; | 549 InstPhi &operator=(const InstPhi &) = delete; |
550 | 550 |
551 public: | 551 public: |
552 static InstPhi *create(Cfg *Func, SizeT MaxSrcs, Variable *Dest) { | 552 static InstPhi *create(Cfg *Func, SizeT MaxSrcs, Variable *Dest) { |
553 return new (Func->allocateInst<InstPhi>()) InstPhi(Func, MaxSrcs, Dest); | 553 return new (Func->allocateInst<InstPhi>()) InstPhi(Func, MaxSrcs, Dest); |
554 } | 554 } |
555 void addArgument(Operand *Source, CfgNode *Label); | 555 void addArgument(Operand *Source, CfgNode *Label); |
556 Operand *getOperandForTarget(CfgNode *Target) const; | 556 Operand *getOperandForTarget(CfgNode *Target) const; |
| 557 CfgNode *getLabel(SizeT Index) const { return Labels[Index]; } |
557 void livenessPhiOperand(LivenessBV &Live, CfgNode *Target, | 558 void livenessPhiOperand(LivenessBV &Live, CfgNode *Target, |
558 Liveness *Liveness); | 559 Liveness *Liveness); |
559 Inst *lower(Cfg *Func); | 560 Inst *lower(Cfg *Func); |
560 void dump(const Cfg *Func) const override; | 561 void dump(const Cfg *Func) const override; |
561 static bool classof(const Inst *Inst) { return Inst->getKind() == Phi; } | 562 static bool classof(const Inst *Inst) { return Inst->getKind() == Phi; } |
562 | 563 |
563 private: | 564 private: |
564 InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest); | 565 InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest); |
565 void destroy(Cfg *Func) override { | 566 void destroy(Cfg *Func) override { |
566 Func->deallocateArrayOf<CfgNode *>(Labels); | 567 Func->deallocateArrayOf<CfgNode *>(Labels); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 InstTarget(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest) | 811 InstTarget(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest) |
811 : Inst(Func, Kind, MaxSrcs, Dest) { | 812 : Inst(Func, Kind, MaxSrcs, Dest) { |
812 assert(Kind >= Target); | 813 assert(Kind >= Target); |
813 } | 814 } |
814 ~InstTarget() override {} | 815 ~InstTarget() override {} |
815 }; | 816 }; |
816 | 817 |
817 } // end of namespace Ice | 818 } // end of namespace Ice |
818 | 819 |
819 #endif // SUBZERO_SRC_ICEINST_H | 820 #endif // SUBZERO_SRC_ICEINST_H |
OLD | NEW |