| 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 | 1087 |
| 1088 bool checkForRedundantAssign(const Variable *Dest, const Operand *Source) { | 1088 bool checkForRedundantAssign(const Variable *Dest, const Operand *Source) { |
| 1089 const auto *SrcVar = llvm::dyn_cast<const Variable>(Source); | 1089 const auto *SrcVar = llvm::dyn_cast<const Variable>(Source); |
| 1090 if (!SrcVar) | 1090 if (!SrcVar) |
| 1091 return false; | 1091 return false; |
| 1092 if (Dest->hasReg() && Dest->getRegNum() == SrcVar->getRegNum()) { | 1092 if (Dest->hasReg() && Dest->getRegNum() == SrcVar->getRegNum()) { |
| 1093 // TODO: On x86-64, instructions like "mov eax, eax" are used to clear the | 1093 // TODO: On x86-64, instructions like "mov eax, eax" are used to clear the |
| 1094 // upper 32 bits of rax. We need to recognize and preserve these. | 1094 // upper 32 bits of rax. We need to recognize and preserve these. |
| 1095 return true; | 1095 return true; |
| 1096 } | 1096 } |
| 1097 if (!Dest->hasReg() && !SrcVar->hasReg() && | 1097 if (!Dest->hasReg() && !SrcVar->hasReg()) { |
| 1098 Dest->getStackOffset() == SrcVar->getStackOffset()) | 1098 if (!Dest->hasStackOffset() || !SrcVar->hasStackOffset()) { |
| 1099 return false; |
| 1100 } |
| 1101 if (Dest->getStackOffset() != SrcVar->getStackOffset()) { |
| 1102 return false; |
| 1103 } |
| 1099 return true; | 1104 return true; |
| 1105 } |
| 1100 return false; | 1106 return false; |
| 1101 } | 1107 } |
| 1102 | 1108 |
| 1103 } // end of namespace Ice | 1109 } // end of namespace Ice |
| OLD | NEW |