Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// | 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- 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 5180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5191 // Skip over the instruction. | 5191 // Skip over the instruction. |
| 5192 Context.advanceNext(); | 5192 Context.advanceNext(); |
| 5193 } | 5193 } |
| 5194 } | 5194 } |
| 5195 } | 5195 } |
| 5196 | 5196 |
| 5197 template <class Machine> | 5197 template <class Machine> |
| 5198 void TargetX86Base<Machine>::lowerUnreachable( | 5198 void TargetX86Base<Machine>::lowerUnreachable( |
| 5199 const InstUnreachable * /*Inst*/) { | 5199 const InstUnreachable * /*Inst*/) { |
| 5200 _ud2(); | 5200 _ud2(); |
| 5201 // Add a fake use of esp to make sure esp stays alive for the entire | |
|
Jim Stichnoth
2015/11/13 23:30:33
Could you factor this code and its lowerRet clone
sehr
2015/11/14 00:30:56
Done.
| |
| 5202 // function. Otherwise post-call esp adjustments get dead-code eliminated. | |
| 5203 // TODO: Are there more places where the fake use should be inserted? E.g. | |
|
Jim Stichnoth
2015/11/13 23:30:33
Remove this TODO because I'm pretty sure this cove
sehr
2015/11/14 00:30:56
Done.
| |
| 5204 // "void f(int n){while(1) g(n);}" may not have an unreachable instruction. | |
| 5205 Variable *esp = | |
| 5206 Func->getTarget()->getPhysicalRegister(Traits::RegisterSet::Reg_esp); | |
|
Jim Stichnoth
2015/11/13 23:30:33
Use getStackReg() instead of Reg_esp.
BTW, getSta
sehr
2015/11/14 00:30:56
Done.
| |
| 5207 Context.insert(InstFakeUse::create(Func, esp)); | |
| 5201 } | 5208 } |
| 5202 | 5209 |
| 5203 template <class Machine> | 5210 template <class Machine> |
| 5204 void TargetX86Base<Machine>::lowerRMW( | 5211 void TargetX86Base<Machine>::lowerRMW( |
| 5205 const typename Traits::Insts::FakeRMW *RMW) { | 5212 const typename Traits::Insts::FakeRMW *RMW) { |
| 5206 // If the beacon variable's live range does not end in this instruction, then | 5213 // If the beacon variable's live range does not end in this instruction, then |
| 5207 // it must end in the modified Store instruction that follows. This means | 5214 // it must end in the modified Store instruction that follows. This means |
| 5208 // that the original Store instruction is still there, either because the | 5215 // that the original Store instruction is still there, either because the |
| 5209 // value being stored is used beyond the Store instruction, or because dead | 5216 // value being stored is used beyond the Store instruction, or because dead |
| 5210 // code elimination did not happen. In either case, we cancel RMW lowering | 5217 // code elimination did not happen. In either case, we cancel RMW lowering |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5978 } | 5985 } |
| 5979 // the offset is not eligible for blinding or pooling, return the original | 5986 // the offset is not eligible for blinding or pooling, return the original |
| 5980 // mem operand | 5987 // mem operand |
| 5981 return MemOperand; | 5988 return MemOperand; |
| 5982 } | 5989 } |
| 5983 | 5990 |
| 5984 } // end of namespace X86Internal | 5991 } // end of namespace X86Internal |
| 5985 } // end of namespace Ice | 5992 } // end of namespace Ice |
| 5986 | 5993 |
| 5987 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H | 5994 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H |
| OLD | NEW |