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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 /// Alloca instruction. This captures the size in bytes as getSrc(0), and the | 240 /// Alloca instruction. This captures the size in bytes as getSrc(0), and the |
241 /// required alignment in bytes. The alignment must be either 0 (no alignment | 241 /// required alignment in bytes. The alignment must be either 0 (no alignment |
242 /// required) or a power of 2. | 242 /// required) or a power of 2. |
243 class InstAlloca : public InstHighLevel { | 243 class InstAlloca : public InstHighLevel { |
244 InstAlloca() = delete; | 244 InstAlloca() = delete; |
245 InstAlloca(const InstAlloca &) = delete; | 245 InstAlloca(const InstAlloca &) = delete; |
246 InstAlloca &operator=(const InstAlloca &) = delete; | 246 InstAlloca &operator=(const InstAlloca &) = delete; |
247 | 247 |
248 public: | 248 public: |
249 static InstAlloca *create(Cfg *Func, Operand *ByteCount, | 249 static InstAlloca *create(Cfg *Func, Variable *Dest, Operand *ByteCount, |
250 uint32_t AlignInBytes, Variable *Dest) { | 250 uint32_t AlignInBytes) { |
251 return new (Func->allocate<InstAlloca>()) | 251 return new (Func->allocate<InstAlloca>()) |
252 InstAlloca(Func, ByteCount, AlignInBytes, Dest); | 252 InstAlloca(Func, Dest, ByteCount, AlignInBytes); |
253 } | 253 } |
254 uint32_t getAlignInBytes() const { return AlignInBytes; } | 254 uint32_t getAlignInBytes() const { return AlignInBytes; } |
255 Operand *getSizeInBytes() const { return getSrc(0); } | 255 Operand *getSizeInBytes() const { return getSrc(0); } |
256 bool getKnownFrameOffset() const { return KnownFrameOffset; } | 256 bool getKnownFrameOffset() const { return KnownFrameOffset; } |
257 void setKnownFrameOffset() { KnownFrameOffset = true; } | 257 void setKnownFrameOffset() { KnownFrameOffset = true; } |
258 void dump(const Cfg *Func) const override; | 258 void dump(const Cfg *Func) const override; |
259 static bool classof(const Inst *Inst) { return Inst->getKind() == Alloca; } | 259 static bool classof(const Inst *Inst) { return Inst->getKind() == Alloca; } |
260 | 260 |
261 private: | 261 private: |
262 InstAlloca(Cfg *Func, Operand *ByteCount, uint32_t AlignInBytes, | 262 InstAlloca(Cfg *Func, Variable *Dest, Operand *ByteCount, |
263 Variable *Dest); | 263 uint32_t AlignInBytes); |
264 | 264 |
265 const uint32_t AlignInBytes; | 265 const uint32_t AlignInBytes; |
266 bool KnownFrameOffset = false; | 266 bool KnownFrameOffset = false; |
267 }; | 267 }; |
268 | 268 |
269 /// Binary arithmetic instruction. The source operands are captured in getSrc(0) | 269 /// Binary arithmetic instruction. The source operands are captured in getSrc(0) |
270 /// and getSrc(1). | 270 /// and getSrc(1). |
271 class InstArithmetic : public InstHighLevel { | 271 class InstArithmetic : public InstHighLevel { |
272 InstArithmetic() = delete; | 272 InstArithmetic() = delete; |
273 InstArithmetic(const InstArithmetic &) = delete; | 273 InstArithmetic(const InstArithmetic &) = delete; |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 static void noteHead(Ice::Inst *, Ice::Inst *) {} | 979 static void noteHead(Ice::Inst *, Ice::Inst *) {} |
980 void deleteNode(Ice::Inst *) {} | 980 void deleteNode(Ice::Inst *) {} |
981 | 981 |
982 private: | 982 private: |
983 mutable ilist_half_node<Ice::Inst> Sentinel; | 983 mutable ilist_half_node<Ice::Inst> Sentinel; |
984 }; | 984 }; |
985 | 985 |
986 } // end of namespace llvm | 986 } // end of namespace llvm |
987 | 987 |
988 #endif // SUBZERO_SRC_ICEINST_H | 988 #endif // SUBZERO_SRC_ICEINST_H |
OLD | NEW |