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

Side by Side Diff: src/IceInst.h

Issue 1392383003: Subzero: Consider all instruction variables for register preference. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 2 months 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 | « no previous file | src/IceInst.cpp » ('j') | src/IceInstARM32.h » ('J')
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 virtual bool isUnconditionalBranch() const { return false; } 120 virtual bool isUnconditionalBranch() const { return false; }
121 /// If the instruction is a branch-type instruction with OldNode as a target, 121 /// If the instruction is a branch-type instruction with OldNode as a target,
122 /// repoint it to NewNode and return true, otherwise return false. Repoint all 122 /// repoint it to NewNode and return true, otherwise return false. Repoint all
123 /// instances of OldNode as a target. 123 /// instances of OldNode as a target.
124 virtual bool repointEdges(CfgNode *OldNode, CfgNode *NewNode) { 124 virtual bool repointEdges(CfgNode *OldNode, CfgNode *NewNode) {
125 (void)OldNode; 125 (void)OldNode;
126 (void)NewNode; 126 (void)NewNode;
127 return false; 127 return false;
128 } 128 }
129 129
130 virtual bool isSimpleAssign() const { return false; } 130 /// Returns true if the instruction is equivalent to a simple
131 /// "var_dest=var_src" assignment where the dest and src are both variables.
132 virtual bool isVarAssign() const { return false; }
131 133
132 void livenessLightweight(Cfg *Func, LivenessBV &Live); 134 void livenessLightweight(Cfg *Func, LivenessBV &Live);
133 /// Calculates liveness for this instruction. Returns true if this instruction 135 /// Calculates liveness for this instruction. Returns true if this instruction
134 /// is (tentatively) still live and should be retained, and false if this 136 /// is (tentatively) still live and should be retained, and false if this
135 /// instruction is (tentatively) dead and should be deleted. The decision is 137 /// instruction is (tentatively) dead and should be deleted. The decision is
136 /// tentative until the liveness dataflow algorithm has converged, and then a 138 /// tentative until the liveness dataflow algorithm has converged, and then a
137 /// separate pass permanently deletes dead instructions. 139 /// separate pass permanently deletes dead instructions.
138 bool liveness(InstNumberT InstNumber, LivenessBV &Live, Liveness *Liveness, 140 bool liveness(InstNumberT InstNumber, LivenessBV &Live, Liveness *Liveness,
139 LiveBeginEndMap *LiveBegin, LiveBeginEndMap *LiveEnd); 141 LiveBeginEndMap *LiveBegin, LiveBeginEndMap *LiveEnd);
140 142
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 /// lowering a Load instruction. 308 /// lowering a Load instruction.
307 class InstAssign : public InstHighLevel { 309 class InstAssign : public InstHighLevel {
308 InstAssign() = delete; 310 InstAssign() = delete;
309 InstAssign(const InstAssign &) = delete; 311 InstAssign(const InstAssign &) = delete;
310 InstAssign &operator=(const InstAssign &) = delete; 312 InstAssign &operator=(const InstAssign &) = delete;
311 313
312 public: 314 public:
313 static InstAssign *create(Cfg *Func, Variable *Dest, Operand *Source) { 315 static InstAssign *create(Cfg *Func, Variable *Dest, Operand *Source) {
314 return new (Func->allocate<InstAssign>()) InstAssign(Func, Dest, Source); 316 return new (Func->allocate<InstAssign>()) InstAssign(Func, Dest, Source);
315 } 317 }
316 bool isSimpleAssign() const override { return true; } 318 bool isVarAssign() const override;
317 void dump(const Cfg *Func) const override; 319 void dump(const Cfg *Func) const override;
318 static bool classof(const Inst *Inst) { return Inst->getKind() == Assign; } 320 static bool classof(const Inst *Inst) { return Inst->getKind() == Assign; }
319 321
320 private: 322 private:
321 InstAssign(Cfg *Func, Variable *Dest, Operand *Source); 323 InstAssign(Cfg *Func, Variable *Dest, Operand *Source);
322 }; 324 };
323 325
324 /// Branch instruction. This represents both conditional and unconditional 326 /// Branch instruction. This represents both conditional and unconditional
325 /// branches. 327 /// branches.
326 class InstBr : public InstHighLevel { 328 class InstBr : public InstHighLevel {
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 static void noteHead(Ice::Inst *, Ice::Inst *) {} 979 static void noteHead(Ice::Inst *, Ice::Inst *) {}
978 void deleteNode(Ice::Inst *) {} 980 void deleteNode(Ice::Inst *) {}
979 981
980 private: 982 private:
981 mutable ilist_half_node<Ice::Inst> Sentinel; 983 mutable ilist_half_node<Ice::Inst> Sentinel;
982 }; 984 };
983 985
984 } // end of namespace llvm 986 } // end of namespace llvm
985 987
986 #endif // SUBZERO_SRC_ICEINST_H 988 #endif // SUBZERO_SRC_ICEINST_H
OLDNEW
« no previous file with comments | « no previous file | src/IceInst.cpp » ('j') | src/IceInstARM32.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698