OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// |
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 Traits::X86OperandMem::DefaultSegment, IsRebased); | 188 Traits::X86OperandMem::DefaultSegment, IsRebased); |
189 } | 189 } |
190 } | 190 } |
191 llvm::report_fatal_error("Unhandled sandboxing type: " + | 191 llvm::report_fatal_error("Unhandled sandboxing type: " + |
192 std::to_string(SandboxingType)); | 192 std::to_string(SandboxingType)); |
193 } | 193 } |
194 | 194 |
195 void TargetX8632::_sub_sp(Operand *Adjustment) { | 195 void TargetX8632::_sub_sp(Operand *Adjustment) { |
196 Variable *esp = getPhysicalRegister(Traits::RegisterSet::Reg_esp); | 196 Variable *esp = getPhysicalRegister(Traits::RegisterSet::Reg_esp); |
197 _sub(esp, Adjustment); | 197 _sub(esp, Adjustment); |
| 198 // Add a fake use of the stack pointer, to prevent the stack pointer adustment |
| 199 // from being dead-code eliminated in a function that doesn't return. |
| 200 Context.insert<InstFakeUse>(esp); |
198 } | 201 } |
199 | 202 |
200 void TargetX8632::_link_bp() { | 203 void TargetX8632::_link_bp() { |
201 Variable *ebp = getPhysicalRegister(Traits::RegisterSet::Reg_ebp); | 204 Variable *ebp = getPhysicalRegister(Traits::RegisterSet::Reg_ebp); |
202 Variable *esp = getPhysicalRegister(Traits::RegisterSet::Reg_esp); | 205 Variable *esp = getPhysicalRegister(Traits::RegisterSet::Reg_esp); |
203 _push(ebp); | 206 _push(ebp); |
204 _mov(ebp, esp); | 207 _mov(ebp, esp); |
205 // Keep ebp live for late-stage liveness analysis (e.g. asm-verbose mode). | 208 // Keep ebp live for late-stage liveness analysis (e.g. asm-verbose mode). |
206 Context.insert<InstFakeUse>(ebp); | 209 Context.insert<InstFakeUse>(ebp); |
207 } | 210 } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 #define X(tag, sizeLog2, align, elts, elty, str, rcstr) \ | 486 #define X(tag, sizeLog2, align, elts, elty, str, rcstr) \ |
484 static_assert(_table1_##tag == _table2_##tag, \ | 487 static_assert(_table1_##tag == _table2_##tag, \ |
485 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); | 488 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); |
486 ICETYPE_TABLE | 489 ICETYPE_TABLE |
487 #undef X | 490 #undef X |
488 } // end of namespace dummy3 | 491 } // end of namespace dummy3 |
489 } // end of anonymous namespace | 492 } // end of anonymous namespace |
490 | 493 |
491 } // end of namespace X8632 | 494 } // end of namespace X8632 |
492 } // end of namespace Ice | 495 } // end of namespace Ice |
OLD | NEW |