| 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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 | 940 |
| 941 void InstTarget::dump(const Cfg *Func) const { | 941 void InstTarget::dump(const Cfg *Func) const { |
| 942 if (!BuildDefs::dump()) | 942 if (!BuildDefs::dump()) |
| 943 return; | 943 return; |
| 944 Ostream &Str = Func->getContext()->getStrDump(); | 944 Ostream &Str = Func->getContext()->getStrDump(); |
| 945 Str << "[TARGET] "; | 945 Str << "[TARGET] "; |
| 946 Inst::dump(Func); | 946 Inst::dump(Func); |
| 947 } | 947 } |
| 948 | 948 |
| 949 bool checkForRedundantAssign(const Variable *Dest, const Operand *Source) { | 949 bool checkForRedundantAssign(const Variable *Dest, const Operand *Source) { |
| 950 const auto SrcVar = llvm::dyn_cast<const Variable>(Source); | 950 const auto *SrcVar = llvm::dyn_cast<const Variable>(Source); |
| 951 if (!SrcVar) | 951 if (!SrcVar) |
| 952 return false; | 952 return false; |
| 953 if (Dest->hasReg() && Dest->getRegNum() == SrcVar->getRegNum()) { | 953 if (Dest->hasReg() && Dest->getRegNum() == SrcVar->getRegNum()) { |
| 954 // TODO: On x86-64, instructions like "mov eax, eax" are used to clear the | 954 // TODO: On x86-64, instructions like "mov eax, eax" are used to clear the |
| 955 // 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. |
| 956 return true; | 956 return true; |
| 957 } | 957 } |
| 958 if (!Dest->hasReg() && !SrcVar->hasReg() && | 958 if (!Dest->hasReg() && !SrcVar->hasReg() && |
| 959 Dest->getStackOffset() == SrcVar->getStackOffset()) | 959 Dest->getStackOffset() == SrcVar->getStackOffset()) |
| 960 return true; | 960 return true; |
| 961 return false; | 961 return false; |
| 962 } | 962 } |
| 963 | 963 |
| 964 } // end of namespace Ice | 964 } // end of namespace Ice |
| OLD | NEW |