[x32] Use ebp/esp as frame and stack pointer
authorPavel Chupin <pavel.v.chupin@intel.com>
Thu, 7 Aug 2014 09:41:19 +0000 (09:41 +0000)
committerPavel Chupin <pavel.v.chupin@intel.com>
Thu, 7 Aug 2014 09:41:19 +0000 (09:41 +0000)
commit5d8c984e5463a26de279b4a0d341a7472fdc7f83
tree07af0f5fdd1e60fb4a3ee3ae563717f43945be35
parent15d82b7d33812d0df391c50e524d789f00fa4a4d
[x32] Use ebp/esp as frame and stack pointer

Summary:
Since pointers are 32-bit on x32 we can use ebp and esp as frame and stack
pointer. Some operations like PUSH/POP and CFI_INSTRUCTION still
require 64-bit register, so using 64-bit MachineFramePtr where required.

X86_64 NaCl uses 64-bit frame/stack pointers, however it's been found that
both isTarget64BitLP64 and isTarget64BitILP32 are true for NaCl. Addressing
this issue here as well by making isTarget64BitLP64 false.

Also mark hasReservedSpillSlot unreachable on X86. See inlined comments.

Test Plan: Add one new simple test and upgrade 2 existing with x32 target case.

Reviewers: nadav, dschuff

Subscribers: llvm-commits, zinovy.nis

Differential Revision: http://reviews.llvm.org/D4617

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215091 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86RegisterInfo.cpp
lib/Target/X86/X86Subtarget.h
test/CodeGen/X86/alloca-align-rounding.ll
test/CodeGen/X86/frameaddr.ll
test/CodeGen/X86/x86-64-stack-and-frame-ptr.ll [new file with mode: 0644]