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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // instruction, which is the last instruction of the block. | 85 // instruction, which is the last instruction of the block. |
86 virtual NodeList getTerminatorEdges() const { | 86 virtual NodeList getTerminatorEdges() const { |
87 // All valid terminator instructions override this method. For | 87 // All valid terminator instructions override this method. For |
88 // the default implementation, we assert in case some CfgNode | 88 // the default implementation, we assert in case some CfgNode |
89 // is constructed without a terminator instruction at the end. | 89 // is constructed without a terminator instruction at the end. |
90 llvm_unreachable( | 90 llvm_unreachable( |
91 "getTerminatorEdges() called on a non-terminator instruction"); | 91 "getTerminatorEdges() called on a non-terminator instruction"); |
92 return NodeList(); | 92 return NodeList(); |
93 } | 93 } |
94 | 94 |
95 // Updates the status of the Variables contained within the | 95 void livenessLightweight(Cfg *Func, llvm::BitVector &Live); |
96 // instruction. In particular, it marks where the Dest variable is | |
97 // first assigned, and it tracks whether variables are live across | |
98 // basic blocks, i.e. used in a different block from their definition. | |
99 void updateVars(CfgNode *Node); | |
100 | |
101 void livenessLightweight(llvm::BitVector &Live); | |
102 void liveness(InstNumberT InstNumber, llvm::BitVector &Live, | 96 void liveness(InstNumberT InstNumber, llvm::BitVector &Live, |
103 Liveness *Liveness, const CfgNode *Node); | 97 Liveness *Liveness, const CfgNode *Node); |
104 | 98 |
105 // Get the number of native instructions that this instruction | 99 // Get the number of native instructions that this instruction |
106 // ultimately emits. By default, high-level instructions don't | 100 // ultimately emits. By default, high-level instructions don't |
107 // result in any native instructions, and a target-specific | 101 // result in any native instructions, and a target-specific |
108 // instruction results in a single native instruction. | 102 // instruction results in a single native instruction. |
109 virtual uint32_t getEmitInstCount() const { return 0; } | 103 virtual uint32_t getEmitInstCount() const { return 0; } |
110 virtual void emit(const Cfg *Func) const; | 104 virtual void emit(const Cfg *Func) const; |
111 virtual void dump(const Cfg *Func) const; | 105 virtual void dump(const Cfg *Func) const; |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 // the Phi source operand is getSrc(I). | 507 // the Phi source operand is getSrc(I). |
514 class InstPhi : public Inst { | 508 class InstPhi : public Inst { |
515 public: | 509 public: |
516 static InstPhi *create(Cfg *Func, SizeT MaxSrcs, Variable *Dest) { | 510 static InstPhi *create(Cfg *Func, SizeT MaxSrcs, Variable *Dest) { |
517 return new (Func->allocateInst<InstPhi>()) InstPhi(Func, MaxSrcs, Dest); | 511 return new (Func->allocateInst<InstPhi>()) InstPhi(Func, MaxSrcs, Dest); |
518 } | 512 } |
519 void addArgument(Operand *Source, CfgNode *Label); | 513 void addArgument(Operand *Source, CfgNode *Label); |
520 Operand *getOperandForTarget(CfgNode *Target) const; | 514 Operand *getOperandForTarget(CfgNode *Target) const; |
521 void livenessPhiOperand(llvm::BitVector &Live, CfgNode *Target, | 515 void livenessPhiOperand(llvm::BitVector &Live, CfgNode *Target, |
522 Liveness *Liveness); | 516 Liveness *Liveness); |
523 Inst *lower(Cfg *Func, CfgNode *Node); | 517 Inst *lower(Cfg *Func); |
524 virtual void dump(const Cfg *Func) const; | 518 virtual void dump(const Cfg *Func) const; |
525 static bool classof(const Inst *Inst) { return Inst->getKind() == Phi; } | 519 static bool classof(const Inst *Inst) { return Inst->getKind() == Phi; } |
526 | 520 |
527 private: | 521 private: |
528 InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest); | 522 InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest); |
529 InstPhi(const InstPhi &) LLVM_DELETED_FUNCTION; | 523 InstPhi(const InstPhi &) LLVM_DELETED_FUNCTION; |
530 InstPhi &operator=(const InstPhi &) LLVM_DELETED_FUNCTION; | 524 InstPhi &operator=(const InstPhi &) LLVM_DELETED_FUNCTION; |
531 virtual void destroy(Cfg *Func) { | 525 virtual void destroy(Cfg *Func) { |
532 Func->deallocateArrayOf<CfgNode *>(Labels); | 526 Func->deallocateArrayOf<CfgNode *>(Labels); |
533 Inst::destroy(Func); | 527 Inst::destroy(Func); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 assert(Kind >= Target); | 760 assert(Kind >= Target); |
767 } | 761 } |
768 InstTarget(const InstTarget &) LLVM_DELETED_FUNCTION; | 762 InstTarget(const InstTarget &) LLVM_DELETED_FUNCTION; |
769 InstTarget &operator=(const InstTarget &) LLVM_DELETED_FUNCTION; | 763 InstTarget &operator=(const InstTarget &) LLVM_DELETED_FUNCTION; |
770 virtual ~InstTarget() {} | 764 virtual ~InstTarget() {} |
771 }; | 765 }; |
772 | 766 |
773 } // end of namespace Ice | 767 } // end of namespace Ice |
774 | 768 |
775 #endif // SUBZERO_SRC_ICEINST_H | 769 #endif // SUBZERO_SRC_ICEINST_H |
OLD | NEW |