Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: src/IceInst.h

Issue 1435363002: Merge fixed alloca stack adjustments into the prolog (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Final code review comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698