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 /// \file | 10 /// \file |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 NumberExtended = NumberInitial - 1 | 85 NumberExtended = NumberInitial - 1 |
86 }; | 86 }; |
87 | 87 |
88 bool isDeleted() const { return Deleted; } | 88 bool isDeleted() const { return Deleted; } |
89 void setDeleted() { Deleted = true; } | 89 void setDeleted() { Deleted = true; } |
90 void setDead(bool Value = true) { Dead = Value; } | 90 void setDead(bool Value = true) { Dead = Value; } |
91 void deleteIfDead(); | 91 void deleteIfDead(); |
92 | 92 |
93 bool hasSideEffects() const { return HasSideEffects; } | 93 bool hasSideEffects() const { return HasSideEffects; } |
94 | 94 |
95 bool isDestNonKillable() const { return IsDestNonKillable; } | 95 bool isDestRedefined() const { return IsDestRedefined; } |
96 void setDestNonKillable() { IsDestNonKillable = true; } | 96 void setDestRedefined() { IsDestRedefined = true; } |
97 | 97 |
98 Variable *getDest() const { return Dest; } | 98 Variable *getDest() const { return Dest; } |
99 | 99 |
100 SizeT getSrcSize() const { return NumSrcs; } | 100 SizeT getSrcSize() const { return NumSrcs; } |
101 Operand *getSrc(SizeT I) const { | 101 Operand *getSrc(SizeT I) const { |
102 assert(I < getSrcSize()); | 102 assert(I < getSrcSize()); |
103 return Srcs[I]; | 103 return Srcs[I]; |
104 } | 104 } |
105 | 105 |
106 bool isLastUse(const Operand *Src) const; | 106 bool isLastUse(const Operand *Src) const; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 /// Deleted means irrevocably deleted. | 185 /// Deleted means irrevocably deleted. |
186 bool Deleted = false; | 186 bool Deleted = false; |
187 /// Dead means one of two things depending on context: (1) pending deletion | 187 /// Dead means one of two things depending on context: (1) pending deletion |
188 /// after liveness analysis converges, or (2) marked for deletion during | 188 /// after liveness analysis converges, or (2) marked for deletion during |
189 /// lowering due to a folded bool operation. | 189 /// lowering due to a folded bool operation. |
190 bool Dead = false; | 190 bool Dead = false; |
191 /// HasSideEffects means the instruction is something like a function call or | 191 /// HasSideEffects means the instruction is something like a function call or |
192 /// a volatile load that can't be removed even if its Dest variable is not | 192 /// a volatile load that can't be removed even if its Dest variable is not |
193 /// live. | 193 /// live. |
194 bool HasSideEffects = false; | 194 bool HasSideEffects = false; |
195 /// IsDestNonKillable means that liveness analysis shouldn't consider this | 195 /// IsDestRedefined indicates that this instruction is not the first |
196 /// instruction to kill the Dest variable. This is used when lowering produces | 196 /// definition of Dest in the basic block. The effect is that liveness |
197 /// two assignments to the same variable. | 197 /// analysis shouldn't consider this instruction to be the start of Dest's |
198 bool IsDestNonKillable = false; | 198 /// live range; rather, there is some other instruction earlier in the basic |
| 199 /// block with the same Dest. This is maintained because liveness analysis |
| 200 /// has an invariant (primarily for performance reasons) that any Variable's |
| 201 /// live range recorded in a basic block has at most one start and at most one |
| 202 /// end. |
| 203 bool IsDestRedefined = false; |
199 | 204 |
200 Variable *Dest; | 205 Variable *Dest; |
201 const SizeT MaxSrcs; // only used for assert | 206 const SizeT MaxSrcs; // only used for assert |
202 SizeT NumSrcs = 0; | 207 SizeT NumSrcs = 0; |
203 Operand **Srcs; | 208 Operand **Srcs; |
204 | 209 |
205 /// LiveRangesEnded marks which Variables' live ranges end in this | 210 /// LiveRangesEnded marks which Variables' live ranges end in this |
206 /// instruction. An instruction can have an arbitrary number of source | 211 /// instruction. An instruction can have an arbitrary number of source |
207 /// operands (e.g. a call instruction), and each source operand can contain 0 | 212 /// operands (e.g. a call instruction), and each source operand can contain 0 |
208 /// or 1 Variable (and target-specific operands could contain more than 1 | 213 /// or 1 Variable (and target-specific operands could contain more than 1 |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 static void noteHead(Ice::Inst *, Ice::Inst *) {} | 977 static void noteHead(Ice::Inst *, Ice::Inst *) {} |
973 void deleteNode(Ice::Inst *) {} | 978 void deleteNode(Ice::Inst *) {} |
974 | 979 |
975 private: | 980 private: |
976 mutable ilist_half_node<Ice::Inst> Sentinel; | 981 mutable ilist_half_node<Ice::Inst> Sentinel; |
977 }; | 982 }; |
978 | 983 |
979 } // end of namespace llvm | 984 } // end of namespace llvm |
980 | 985 |
981 #endif // SUBZERO_SRC_ICEINST_H | 986 #endif // SUBZERO_SRC_ICEINST_H |
OLD | NEW |