In this patch, we teach X86_64TargetMachine that it has a ILP32
authorEli Bendersky <eliben@google.com>
Fri, 25 Jan 2013 22:07:43 +0000 (22:07 +0000)
committerEli Bendersky <eliben@google.com>
Fri, 25 Jan 2013 22:07:43 +0000 (22:07 +0000)
commit597fc1233a82f66439027adefe37a48d156af5a2
tree83a6f9a6dc0a1bb760949ceb8e0ed1181206f714
parent158ea095c07287130efeaff5fe9b4566c976d255
In this patch, we teach X86_64TargetMachine that it has a ILP32
(defined by the x32 ABI) mode, in which case its pointers are 32-bits
in size. This knowledge is also added to X86RegisterInfo that now
returns the appropriate registers in getPointerRegClass.

There are many outcomes to this change. In order to keep the patches
separate and manageable, we start by focusing on some simple testable
cases. The patch adds a test with passing a pointer to a function -
focusing on the difference between the two data models for x86-64.
Another test is added for handling of 'sret' arguments (and
functionality is added in X86ISelLowering to make it work).

A note on naming: the "x32 ABI" document refers to the AMD64
architecture (in LLVM it's distinguished by being is64Bits() in the
x86 subtarget) with two variations: the LP64 (default) data model, and
the ILP32 data model. This patch adds predicates to the subtarget
which are consistent with this naming scheme.

llvm-svn: 173503
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86RegisterInfo.cpp
llvm/lib/Target/X86/X86Subtarget.h
llvm/lib/Target/X86/X86TargetMachine.cpp
llvm/test/CodeGen/X86/x86-64-ptr-arg-simple.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/x86-64-sret-return.ll