OLD | NEW |
1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===// | 1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===// |
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 bool InstArithmetic::isCommutative() const { | 243 bool InstArithmetic::isCommutative() const { |
244 return InstArithmeticAttributes[getOp()].IsCommutative; | 244 return InstArithmeticAttributes[getOp()].IsCommutative; |
245 } | 245 } |
246 | 246 |
247 InstAssign::InstAssign(Cfg *Func, Variable *Dest, Operand *Source) | 247 InstAssign::InstAssign(Cfg *Func, Variable *Dest, Operand *Source) |
248 : InstHighLevel(Func, Inst::Assign, 1, Dest) { | 248 : InstHighLevel(Func, Inst::Assign, 1, Dest) { |
249 addSource(Source); | 249 addSource(Source); |
250 } | 250 } |
251 | 251 |
| 252 bool InstAssign::isVarAssign() const { return llvm::isa<Variable>(getSrc(0)); } |
| 253 |
252 // If TargetTrue==TargetFalse, we turn it into an unconditional branch. This | 254 // If TargetTrue==TargetFalse, we turn it into an unconditional branch. This |
253 // ensures that, along with the 'switch' instruction semantics, there is at | 255 // ensures that, along with the 'switch' instruction semantics, there is at |
254 // most one edge from one node to another. | 256 // most one edge from one node to another. |
255 InstBr::InstBr(Cfg *Func, Operand *Source, CfgNode *TargetTrue_, | 257 InstBr::InstBr(Cfg *Func, Operand *Source, CfgNode *TargetTrue_, |
256 CfgNode *TargetFalse_) | 258 CfgNode *TargetFalse_) |
257 : InstHighLevel(Func, Inst::Br, 1, nullptr), TargetFalse(TargetFalse_), | 259 : InstHighLevel(Func, Inst::Br, 1, nullptr), TargetFalse(TargetFalse_), |
258 TargetTrue(TargetTrue_) { | 260 TargetTrue(TargetTrue_) { |
259 if (TargetTrue == TargetFalse) { | 261 if (TargetTrue == TargetFalse) { |
260 TargetTrue = nullptr; // turn into unconditional version | 262 TargetTrue = nullptr; // turn into unconditional version |
261 } else { | 263 } else { |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 // upper 32 bits of rax. We need to recognize and preserve these. | 955 // upper 32 bits of rax. We need to recognize and preserve these. |
954 return true; | 956 return true; |
955 } | 957 } |
956 if (!Dest->hasReg() && !SrcVar->hasReg() && | 958 if (!Dest->hasReg() && !SrcVar->hasReg() && |
957 Dest->getStackOffset() == SrcVar->getStackOffset()) | 959 Dest->getStackOffset() == SrcVar->getStackOffset()) |
958 return true; | 960 return true; |
959 return false; | 961 return false; |
960 } | 962 } |
961 | 963 |
962 } // end of namespace Ice | 964 } // end of namespace Ice |
OLD | NEW |