History log of /external/clang/lib/CodeGen/TargetInfo.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
eaf856db5d1a272dc7188937206ef4572836f82a 13-Apr-2012 Anton Korobeynikov <asl@math.spbu.ru> Step forward with supporting of ARM homogenous aggregates:
- Handle unions
- Handle C++ classes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
edfac0302490d84419eb958c812c533b8df29785 10-Mar-2012 Daniel Dunbar <daniel@zuster.org> IRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.

- We do this when it is easy to determine that the backend will pass them on
the stack properly by itself.

Currently LLVM codegen is really bad in some cases with byval, for example, on
the test case here (which is derived from Sema code, which likes to pass
SourceLocations around)::

struct s47 { unsigned a; };
void f47(int,int,int,int,int,int,struct s47);
void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); }

we used to emit code like this::

...
movl %esi, -8(%rbp)
movl -8(%rbp), %ecx
movl %ecx, (%rsp)
...

to handle moving the struct onto the stack, which is just appalling.

Now we generate::

movl %esi, (%rsp)

which seems better, no?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
6c60c8d7466b3191602dbb8e4a81f4ee7d9a09a6 22-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Adding support for Microsoft's thiscall calling convention. Clang side of the patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
de5d3c717684f3821b8db58037bc7140acf134aa 17-Feb-2012 John McCall <rjmccall@apple.com> Whether an argument is required (in contrast with being an
optional argument passed through the variadic ellipsis)
potentially affects how we need to lower it. Propagate
this information down to the various getFunctionInfo(...)
overloads on CodeGenTypes. Furthermore, rename those
overloads to clarify their distinct purposes, and make
sure we're calling the right one in the right place.
This has a nice side-effect of making it easier to construct
a function type, since the 'variadic' bit is no longer
separable.

This shouldn't really change anything for our existing
platforms, with one minor exception --- we should now call
variadic ObjC methods with the ... in the "right place"
(see the test case), which I guess matters for anyone
running GNUStep on MIPS. Mostly it's just a substantial
clean-up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a34e92116581531f7325527d952a9ffcc819d905 09-Feb-2012 Akira Hatanaka <ahatanaka@mips.com> Class objects passed by value follow the same rules as structure objects.
Double fields of by-value class objects should be passed in floating point
registers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
da54ff306270e179f64d046369419724356d30d7 09-Feb-2012 Akira Hatanaka <ahatanaka@mips.com> Fix bugs in function MipsABIInfo::returnAggregateInRegs. Functions returning
class objects follow the same rules as those returning struct objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
526cdfb2bf51c8c6612504f1d06c02c736d3d126 08-Feb-2012 Akira Hatanaka <ahatanaka@mips.com> Do not return records with non trivial destructors or copy constructors in
registers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8b418685e9e4f02f4eb2a76e1ec063e07552b68d 07-Feb-2012 Chris Lattner <sabre@nondot.org> simplify a bunch of code to use the well-known LLVM IR types computed by CodeGenModule.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
55fc7e2b8005ba87a81664d065e9b9e2fff1b1af 25-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Add some ABI tweaks for i386-pc-win32 triple so that we return structs in an MSVC-compatible way. Patch by Joe Groff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8f675e4b18fb9b8972847e9f681044184da5586c 24-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Make sure the integer type used to align the vaarg address is the same as the
type of pointers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a8536c086fbac59bd7f9a6493bc99b4a92d585e4 24-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Ignore return type if its size is zero.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
3026348bd4c13a0f83b59839f64065e0fcbea253 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
cc66254946ec86a2ec94ff9c8db96b05a364a94f 12-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Take into account the pointer to an aggregate that is passed as a hidden
argument when Offset is initialized.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
2afd23da0e33a8cd44c1c46b1651c677fdd27151 12-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Call CodeGenTypes::ConvertType to get LLVM::Type*.
Remove function MipsABIInfo::GetFloatingPointTy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9db0a5e7e360d8048c83ee1c46a88c4172182791 11-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Remove switch/case statements and call GetFloatingPointTy() instead to get the
floating point type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
6d1080fd1851f18bd40bb46fa074aa1252b13e8e 11-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Flatten float complex arguments. N32/64 requires float complex arguments be
passed in floating point registers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9659d59ec368933050684af573b6d32ab5714332 10-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Remove space.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
b43550bf1bd944a16cdae9703cb1c2049b04e6bd 10-Jan-2012 Chandler Carruth <chandlerc@gmail.com> Add support for the androideabi environment to our triple support, and
for the arm-linux-androideabi triple in particular.

Also use this to do a better job of selecting soft FP settings.

Patch by Evgeniy Stepanov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
91ee4a7f36b520248f505f7d82418eb8fc08f315 10-Jan-2012 Joerg Sonnenberger <joerg@bec.de> Contrary to the other BSDs, NetBSD followed the ELF ABI for structure
passing on i386 and does not use registers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a33fd393d5255716e904fed021f87260095ed00a 09-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Insert padding before unaligned long double arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
f0cc2087b18c48b17c2f647c88a3e7eef19285fd 07-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Add field PaddingType to ABIArgInfo which specifies the type of padding that
is inserted before the real argument. Padding is needed to ensure the backend
reads from or writes to the correct argument slots when the original alignment
of a byval structure is unavailable due to flattening.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
c7ecc2e3691e484cffcfec7fcefef18b2bd23e5f 04-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Have functions return structures smaller than 128-bit in registers if ABI
is either N32 or N64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9631939f82c0eaa6fb3936a0ce58a41adfbc9011 12-Dec-2011 Tony Linthicum <tlinth@codeaurora.org> Hexagon backend support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
68805fef77978e69a14584148a3c6a4239e34171 06-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Minor comment update.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ee1ad99f1ced9ffee436466ef674d4541c37864e 02-Dec-2011 Eli Friedman <eli.friedman@gmail.com> When we're passing a vector with an illegal type through memory on x86-64, use byval so we're sure the backend does the right thing. Fixes va_arg with illegal vectors and an obscure ABI mismatch with __m64 vectors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
3ed7903d27f0e7e0cd3a61c165d39eca70f3cff5 01-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Don't use a varargs convention for calls unprototyped functions where one of the arguments is an AVX vector.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ce275675d33142c235d7027db16abe43da616ee4 29-Nov-2011 Tanya Lattner <tonic@nondot.org> Correct the code generation for function arguments of vec3 types on x86_64 when they are greater than 128 bits. This was incorrectly coercing things like long3 into a double2.
Add test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
5a1ac89b244940a0337ea7ae7dc371e2a9bf7c50 18-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Finish r144971, which was an incomplete commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
7e7ad3f8fa150de6144be332ae4bfe5d1acb5c6d 18-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix the meaning of an "empty" record for the case of a zero-length array. Use isEmptyRecord for arguments on x86-32; there are structs of size 0 which don't count as empty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8d2fe42417fcc861b3324d585dc29ac4da59bee0 18-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Make va_arg on x86-64 compute alignment the same way as argument passing.

Fixes <rdar://problem/10463281>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
7b1fb81a512def2a20e2834b4598a7b3a740dc7f 18-Nov-2011 Eli Friedman <eli.friedman@gmail.com> A bunch of fixes to argument passing and va_arg on Darwin x86-32 for structures containing an SSE vector.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
506d4e375a6a36a49eb70578983dc4acaf2f15ae 18-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Don't try to expand struct arguments containing holes on x86-32. From gcc struct layout tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
bd4d3bcd2cd64d1bba29b2a52705b97d68ebccd5 18-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Simplify code for returning a struct for Darwin x86-32 ABI. Use a better type for a function returning a struct containing only a pointer. Handle the edge case of a struct containing only a float or double plus some dead padding instead of asserting.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
5a4d35247f55dae6dd0d5ad349ecadbbea0b4572 18-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Ignore empty unions in argument lowering on x86-32. From gcc struct layout tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
b49d5a6606ec9b912f74279c935934c4ecb39dfa 04-Nov-2011 Akira Hatanaka <ahatanaka@mips.com> Use a single integer type for a sub-doubleword part of a byval structure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
90306934bccaadaf2b538b3c90c3dd478aa1e7d8 03-Nov-2011 Jan Wen Voung <jvoung@google.com> Do not add "byval" attribute to records with non-trivial copy constructors
and destructors in the DefaultABIInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
b551dd31f6b15aa959127ee906084fcf5bf0154e 03-Nov-2011 Akira Hatanaka <ahatanaka@mips.com> Set MinABIStackAlignInBytes to 8 if ABI is N32/64.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
d5a257f39b6f78fb66bb0227486b65592476c572 03-Nov-2011 Akira Hatanaka <ahatanaka@mips.com> Convert the type of a structure passed by value if it has double precision
fields in order to ease handling of such structures in backend.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
c0e3b665344a39bd733e0d9f55bf0f1937922289 03-Nov-2011 Akira Hatanaka <ahatanaka@mips.com> Return function results whose size is smaller than 128-bits in registers if ABI
is N32/64.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
3b694fab31d3a7a8379996cbe7ef8d53f7d677bc 02-Nov-2011 Bob Wilson <bob.wilson@apple.com> Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0986eb5c59c43809df95bac10138edd44c1ebb69 25-Oct-2011 Dan Gohman <gohman@apple.com> Remove the SystemZ backend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
2f7aa998c0d6494301c12c4fceb6134a1bc248ab 13-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> TCE target: conversion of OpenCL reqd_work_group_size attr to metadata

Patch by Pekka Jääskeläinen!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a6b8b2c09610b8bc4330e948ece8b940c2386406 10-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation refactoring:
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0628b724ff68105dc88af00a39f859447f22981e 08-Oct-2011 Ted Kremenek <kremenek@apple.com> Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an obvious memory leak that was reported from LLDB devs. The comment indicates the leak is deliberate, but I have no idea why this needs to be so. Please comment/revert if you know otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
744d90bfe2a43847764a707b1bee7ef1e30ad5f2 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> CUDA: set proper calling conventions for PTX

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
818eafb6ac56c87b80b34be29ca115cd309026d2 05-Oct-2011 Justin Holewinski <justin.holewinski@gmail.com> PTX: Set proper calling conventions for PTX in OpenCL mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
eb2d1f1c88836bd5382e5d7aa8f6b85148a88b27 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Removing a bunch of dead returns/breaks after llvm_unreachables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
01f151e0ffba72bcad770bea5f563a9b68ca050e 21-Sep-2011 John McCall <rjmccall@apple.com> ANSI C requires that a call to an unprototyped function type succeed
if the definition has a non-variadic prototype with compatible
parameters. Therefore, the default rule for such calls must be to
use a non-variadic convention. Achieve this by casting the callee to
the function type with which it is required to be compatible, unless
the target specifically opts out and insists that unprototyped calls
should use the variadic rules. The only case of that I'm aware of is
the x86-64 convention, which passes arguments the same way in both
cases but also sets a small amount of extra information; here we seek
to maintain compatibility with GCC, which does set this when calling
an unprototyped function.

Addresses PR10810 and PR10713.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8c6dfbe044155277b06e4345f1b98910692390b6 20-Sep-2011 Akira Hatanaka <ahatanak@gmail.com> Create a MipsTargetCodeGenInfo object for mips64/mips64el. The size of the
UnwindException structure is 32 for mips64.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
e624fa02b2c2c614b3a27a25516885fc64e07001 20-Sep-2011 Akira Hatanaka <ahatanak@gmail.com> Add a parameter to MipsTargetCodeGenInfo's constructor.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
bcfd1f55bfbb3e5944cd5e03d07b343e280838c4 02-Sep-2011 Douglas Gregor <dgregor@apple.com> Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
49e34be6ae0c25b9843610cdd2fd6fea9cd8b870 30-Aug-2011 John McCall <rjmccall@apple.com> The size of struct UnwindException varies by platform with no
apparent general rule. Just special-case it as appropriate.
PR10789.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
7b0a0383ef5ba23cbf2968f7cb314be0b80847e8 12-Aug-2011 Akira Hatanaka <ahatanak@gmail.com> Alignment of a va_arg must be at least as large as the ABI's minimum alignment.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
3827e42982d578ace7713f2e43a7e7e2fa5f8418 12-Aug-2011 Akira Hatanaka <ahatanak@gmail.com> Add definition of a static member of a class.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
194f06a476d299a7a70e5ff1d152f5895dc0a76c 03-Aug-2011 Bob Wilson <bob.wilson@apple.com> Handle "homogeneous aggregates" as required by the ARM AAPCS-VFP ABI.

A homogeneous aggregate is an aggregate data structure where after flattening
any nesting there are 1 to 4 elements of the same base type that is either a
float, double, or Neon vector. All Neon vectors of the same size, either 64
or 128 bits, are treated as equivalent for this purpose. When using the
AAPCS-VFP ABI, check for homogeneous aggregates and pass them as arguments by
expanding them into a sequence of their base types. This requires extending
the existing support for expanded arguments to handle not only structs, but
also constant arrays and complex types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
e164c180527354acc16c1b9b2c5a5ed4a1e484d4 03-Aug-2011 Rafael Espindola <rafael.espindola@gmail.com> Implements alignment for long long and double types in va_arg on ARM AAPCS.
Patch by Jim (Ningjie) Chen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
53fc1a6151ec31350309f479c0d2252366e4815c 02-Aug-2011 Bob Wilson <bob.wilson@apple.com> Revert "Re-enable byval for ARM in clang. rdar://problem/7662569"

This reverts commit 67d097e1232b7d66f58989c16a45b8a11721f76e.
We found a miscompile with ARM byval, which is still being investigated.
In the meantime, this works around the problem by disabling ARM byval.

Conflicts:
lib/CodeGen/TargetInfo.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
c35e69d758e43563ec3785cdd4472d9f2386cf9a 01-Aug-2011 Akira Hatanaka <ahatanak@gmail.com> Implement MipsABIInfo::EmitVAArg. This fix enables clang to complete compilation
without bailing out when va_arg is an aggregate expression. However,
alignment checking needs to be added in isSafeToEliminateVarargsCast in
InstCombineCalls.cpp in order to produce correct mips code (see link below).

http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-July/042047.html





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
511949bf7ea721556ea3eb2777fc1e36e6c3e243 01-Aug-2011 Akira Hatanaka <ahatanak@gmail.com> Pass records with non-trivial destructors or constructors indirectly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
2acc6e3feda5e4f7d9009bdcf8b1cd777fecfe2d 18-Jul-2011 Chris Lattner <sabre@nondot.org> de-constify llvm::Type, patch by David Blaikie!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
e9b5d77b7bfd3e8bba05df9914a6e8c336d68ff3 15-Jul-2011 Joerg Sonnenberger <joerg@bec.de> Fix typo


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
b8981df0ed2886dfa221f2fad6d86872c39d3549 13-Jul-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
548e478b8bd02b0295bc4efd0c282337f00646fd 13-Jul-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Revert r134946

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
75d28b58d97c60cc01898b8e4ca958c27aef05c7 12-Jul-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Fix a typo!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
089d8927abe73fe6a806987937d9b54b1a7a8659 12-Jul-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Do the same as r134946 for arrays. Add more testcases for avx x86_64 arg
passing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ccafadb68f5a8132a4ee23f441cf5d6976a4133b 12-Jul-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Fix one x86_64 abi issue and the test to actually look for the right thing,
which is: { <4 x float>, <4 x float> } should continue to go through memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
4943c15df59fdec444656a48c16e72a2077ab61f 12-Jul-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Reapply r134754, which turns out to be working correctly and also
add one more testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ef6de3da8572607f786303c07150daa6e140ab19 11-Jul-2011 Jay Foad <jay.foad@gmail.com> De-constify Types in StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9cbe4f0ba01ec304e1e3d071c071f7bca33631c0 09-Jul-2011 Chris Lattner <sabre@nondot.org> clang side to match the LLVM IR type system rewrite patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
c3e0fb406fb6fe83566dc6d8b05362e0a2c1e191 09-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Change -mno-mmx to be more compatible with gcc. Specifically, -mno-mmx should not imply -mno-sse.

Note that because we don't usually touch the MMX registers anyway, all -mno-mmx needs to do is tweak the x86-32 calling convention a little for vectors that look like MMX vectors, and prevent the definition of __MMX__.

clang doesn't actually stop the user from using MMX inline asm operands or MMX builtins in -mno-mmx mode; as a QOI issue, it would be nice to diagnose, but I doubt it really matters much.

<rdar://problem/9694837>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
528a8c7b4c39ae1c551760fd087a508a71ee9541 09-Jul-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Revert x86_64 ABI changes until I have time to check the items raised by Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
df41b4c10ab2a0096957e415e520bd467f8b2e9e 09-Jul-2011 Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Add support for AVX 256-bit in the x86_64 ABI (as in the 0.99.5 draft)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
14508ff0bffee0fdfe5d336946c6db0e709099c8 02-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Don't use x86_mmx where it isn't necessary.

The start of some work on getting -mno-mmx working the way we want it to.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ded137fcab19f0aace08a28b5c91574e6b23debc 29-Jun-2011 Eli Friedman <eli.friedman@gmail.com> We don't pass classes with a copy-constructor or destructor byval, so the address takes up an integer register (if one is available). Make sure the x86-64 ABI implementation takes that into account properly.

The fixed implementation is compatible with the implementation both gcc and llvm-gcc use.

rdar://9686430 . (This is the issue that was reported in the thread "[LLVMdev] Segfault calling LLVM libs from a clang-compiled executable".)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
4857947d18a7d0d0c250892fc5597ec0aecc9823 21-Jun-2011 NAKAMURA Takumi <geek4civic@gmail.com> De-Unicode-ify in comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
7650d95a1a616ea300f37126a8dfc93dc19a662a 19-Jun-2011 Chris Lattner <sabre@nondot.org> update for api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
f85e193739c953358c865005855253af4f68a497 16-Jun-2011 John McCall <rjmccall@apple.com> Automatic Reference Counting.

Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
619e8875d29cc019c7360595f66b9f91b3439494 02-Jun-2011 Akira Hatanaka <ahatanak@gmail.com> Add stuff for o32 ABI conformance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
de92d739ba0ef42a5a7dcfd6e170329549d0716b 23-May-2011 Chris Lattner <sabre@nondot.org> make the x86-32 backend specify a byval alignment, even when the
code generator will do it. With this patch, clang compiles the example
in PR9794 to not have an alloca temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
855d227967f8332237f1f1cf8eb63a1e22d8be05 23-May-2011 Chris Lattner <sabre@nondot.org> Fix x86-64 byval passing to specify the alignment even when the code
generator will give it something sufficient. This is important because
the mid-level optimizer doesn't know what alignment is required otherwise.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
09345d1c2adf95ea90f06911dbb4f12372b7f24c 18-May-2011 Roman Divacky <rdivacky@freebsd.org> Add ARMTargetCodeGenInfo::initDwarfEHRegSizeTable() defining 16 32bit regs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
c5f18f3e8c3f1e9cb25534f9a9676f112bedc2a7 17-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r131447, see if it fixes the buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
b7d2516f5dd1e5dfb112fc4e273db16f636b7fdc 17-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Inside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a1dadc9874992fdb5a9a721bec6cf1b9f0e90fed 28-Apr-2011 Stuart Hastings <stuart@apple.com> Raise ARM byval minimum size from 32 to 64, addressing a performance
regression in mason. rdar://problem/7662569


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ea971e968f2e4a2cd8cbaf4a8cb416ed70c35ffb 28-Apr-2011 Stuart Hastings <stuart@apple.com> Replace unitary array with scalar. rdar://problem/7662569

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
b7f62d01369c2a6e4af5dd2a76052ae65892161d 28-Apr-2011 Stuart Hastings <stuart@apple.com> Replace SmallVector with an array, as suggested by Frits van Bommel. rdar://problem/7662569

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
67d097e1232b7d66f58989c16a45b8a11721f76e 27-Apr-2011 Stuart Hastings <stuart@apple.com> Re-enable byval for ARM in clang. rdar://problem/7662569

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ad27eeaf03fc834f5e8e8d5b343582fe6b29000d 26-Apr-2011 Eric Christopher <echristo@apple.com> Temporarily revert r130176, it appears to have broken a few tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
df39fa2811933737974862ad376f140e4cdfeee1 26-Apr-2011 Stuart Hastings <stuart@apple.com> Turn on byval parameters in Clang for ARM APCS. rdar://problem/7662569

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0259c3a3df3c2f3b9de7e3845df1eea3ac04e1aa 22-Apr-2011 Justin Holewinski <justin.holewinski@gmail.com> PTX: Add default PTX calling conventions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
67a5773ba529aebcad03fa5e7cc95555d133e93d 21-Apr-2011 John McCall <rjmccall@apple.com> The 0.98 revision of the x86-64 ABI clarified a lot of things, some
of which break strict compatibility with previous compilers. Implement
one of them and then immediately opt out on Darwin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
db57a4cdb0a6abf3239f3a794a900ce312c5887b 19-Apr-2011 Daniel Dunbar <daniel@zuster.org> ADT/Triple: Switch to using .isOSDarwin() predicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
fc8f0e14ad142ed811e90fbd9a30e419e301c717 15-Apr-2011 Chris Lattner <sabre@nondot.org> fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
414d8967e1d760ea1e19a4aca96b13777a8cf8c5 14-Apr-2011 Anton Korobeynikov <asl@math.spbu.ru> Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86.

In particular, all library functions should always be AAPCS regardless of floating point ABI used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
34c1af83e159cfe0f43e7a855e84783f301fc1f1 05-Apr-2011 Sandeep Patel <deeppatel1987@gmail.com> Set AAPCS-VFP calling convention accordingly and hard float ABI command handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
bbf3bacb3e0c1ebb3e8a4a8b1330404a7e379315 30-Mar-2011 Jay Foad <jay.foad@gmail.com> Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0507be662df482b5c67b7905ed7ca368cb5c6b69 07-Mar-2011 Bill Wendling <isanbard@gmail.com> When we adjust the inline ASM type, we need to take into account an early
clobber with the 'y' constraint. Otherwise, we get the wrong return type and an
assert, because it created a '<1 x i64>' vector type instead of the x86_mmx
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9c6082fe89c61af697f017aa80937581cc2128d8 02-Mar-2011 Tilmann Scheller <tilmann.scheller@googlemail.com> Revert "Add CC_Win64ThisCall and set it in the necessary places."

This reverts commit 126863.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
88d117c2eedd7c5bec57ac983a98d5e12bdd2cc6 02-Mar-2011 Tilmann Scheller <tilmann.scheller@googlemail.com> Add CC_Win64ThisCall and set it in the necessary places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
6f17433b2d50262856ab09f52af96c6132b01012 22-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/CodeGen/TargetInfo.cpp: On Win64, arg i128 should be emitted as INDIRECT.

mingw-w64's i128 tweak should be done with x86_64-mingw32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
4b93d660c6326ec79b5e369317d1051cf826c2f3 20-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Re-instate r125819 and r125820 with no functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
96b1d4b4eb6b18dd6df7a2c0833332b45840580f 19-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 125820 and 125819 to fix PR9266.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ef9a1d0e13662162aa8cdae8732c33b5d751d80c 18-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Move TargetInfo::adjustInlineAsmType to TargetCodeGenInfo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0aa205765aec0aa5eed672f8e3cade543372edcd 17-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.

No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
125b4cb35536e45201f8f2cb19ee620e3ad67c49 17-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8e50a96b387dca7525caa8a6add31420dd82a2cd 02-Feb-2011 Benjamin Kramer <benny.kra@googlemail.com> Add NetBSD target support. Patch by Joerg Sonnenberger.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ff8be0e08e409af53130d12ce36019b35288fb78 19-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/CodeGen/TargetInfo.cpp: Fix coding style and erase an obsolete comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a75732201b19059a0e56a88b0eb5a0e5dd3c6ca3 17-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/CodeGen/TargetInfo.cpp: Add Win64 calling conversion.

FIXME: It would be incompatible to Microsoft's in one point.
On mingw64-gcc, {i128} is expanded for args and returned as {rax, rdx}.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
29dd67bc59249adef304827d68b094f5b5cfc645 11-Jan-2011 Bob Wilson <bob.wilson@apple.com> Remove special handling for opaque Neon vector types.
Clang does not wrap the vectors in structs anymore so this isn't needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0024f940dd15987b8ffbe6e787dcf860a9ea1eff 11-Jan-2011 Bob Wilson <bob.wilson@apple.com> Move DefaultABIInfo::classifyReturnType where it belongs. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
276fdf408050d205f3a7f34c1e788224a67d2098 19-Dec-2010 Wesley Peck <peckw@wesleypeck.com> 1. Add some ABI information for the Microblaze.
2. Add attibutes "interrupt_handler" and "save_volatiles" for the Microblaze target.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
77d6605159dd7b512be8e555f4fe78b2d6c34290 12-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Use a twine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a14f5979572aa25c03d24750ee4724d2031d4ede 01-Nov-2010 Anders Carlsson <andersca@mac.com> Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9cac4942b920d4c5514e71949e3062ed626bfbdf 19-Oct-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
99aaae87ae972ac2dd4cccd8b4886537aabaff43 19-Oct-2010 Bill Wendling <isanbard@gmail.com> We shouldn't keep track of MMX registers "needed" separately from the SSE
registers needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
bb465d7d0489a6605bb1eb82dea87350066ac5e2 18-Oct-2010 Bill Wendling <isanbard@gmail.com> Reapply r116684 with fixes. The test cases needed to be updated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
b70fba451e5a92df6f77ca288caf80b0c5572593 17-Oct-2010 Bill Wendling <isanbard@gmail.com> Temporarily revert r116684. It was causing failures with

Clang :: CodeGen/x86_32-arguments-darwin.c
Clang :: CodeGen/x86_32-arguments-linux.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
51a9f5309a025f5c54e7dc373eb7d11daabee6df 17-Oct-2010 Bill Wendling <isanbard@gmail.com> The "gcc.dg/compat/vector-1 -m32" test was broken after the MMX rewrite. The
function parameters weren't converted to use the correct type (x86_mmx). Add a
check, similar to the one in llvm-gcc, to see if we need the x86_mmx type for
that function parameter. If so, it coerces the type to be that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
757e685512b8616c9de918b3d3fad8247562dce2 11-Oct-2010 Chris Lattner <sabre@nondot.org> Per discussion with Sanjiv, remove the PIC16 target from mainline. When/if
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
f554b1cc3083d9ed1fb9b52a305025f744e90d08 23-Sep-2010 Daniel Dunbar <daniel@zuster.org> IRgen/ABI/ARM: Return large vectors in memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8aa87c71d9bfec14e135c683b0d7b9de999dbcb0 23-Sep-2010 Daniel Dunbar <daniel@zuster.org> IRgen/ABI/ARM: Trust the backend to pass vectors correctly for the given ABI.
- Therefore, we can lower out the NEON wrapper structs and pass the vectors
directly. This makes a huge difference in the cleanliness of the IR after
optimization.
- I will trust, but verify, via future ABITest testing (for APCS-GNU, at
least).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
e59d8585bb40a8bae6b847ad258536a2c01f20ea 16-Sep-2010 Daniel Dunbar <daniel@zuster.org> IRgen/ABI/x86-32: Realign indirect arguments when the ABI requires us to pass
them with a smaller alignment than the rest of codegen expects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
cf3b6f2504596812db1fcef0df8ce5b3449c4aac 16-Sep-2010 Daniel Dunbar <daniel@zuster.org> IRgen/ABI: Add support for realigning structures which are passed by indirect
reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
93ae947df36133c7a26a0c7d325c0679916ed2ed 16-Sep-2010 Daniel Dunbar <daniel@zuster.org> IRgen/ABI/x86_32/Darwin: On Darwin, only structures with SSE vector types get passed
with a non-default-stack-ABI-alignment (of 16).
- This fixes the ABI convenient, but breaks codegen since we now have
underaligned arguments. Marginal improvement overall though, and will be
fixed in next commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
fb67d6c3814524fdd43bd2fb159f7c594eae581c 16-Sep-2010 Daniel Dunbar <daniel@zuster.org> IRgen/x86_32/Linux: Linux seems to align all stack objects to 4 bytes, unlike
Darwin. Checked vs the handiest Linux llvm-gcc I had around, someone on Linux is
welcome to investigate more.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
66e7b68b0016aeebe349e21ace93ff0178665d69 01-Sep-2010 Chris Lattner <sabre@nondot.org> fix rdar://8360877 a really nasty miscompilation in Boost.Xpressive
caused by my ABI work. Passing:

struct outer {
int x;
struct epsilon_matcher {} e;
int f;
};

as {i32,i32} isn't safe, because the offset of the second element
needs to be at 8 when it is interpreted as a memory value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
645406a3d3405ad0f4b5a0e46a34ae92d9d23bd3 01-Sep-2010 Chris Lattner <sabre@nondot.org> same refactoring as before, this time on the argument side.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
3db4dde12de84269c8f803f9dfca37a2d14f9898 01-Sep-2010 Chris Lattner <sabre@nondot.org> refactor some code to cut down on redundancy, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
f13721dd91dda7675e499331a2770308ad20ca61 31-Aug-2010 Chris Lattner <sabre@nondot.org> Add support for windows x86-64 varargs, patch by Cameron Esfahani!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
4599f346cb90bef15e1afd5c66f20c18703e41ae 31-Aug-2010 Chris Lattner <sabre@nondot.org> Fix PR8029, a x86-32 ABI regression in introduced in r112211


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
7b733505defd34f1bb7e74d9526be0bc41e76693 26-Aug-2010 Chris Lattner <sabre@nondot.org> improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
bbae8b40cd37d5b2815f8450cb588a41da89d7e5 26-Aug-2010 Chris Lattner <sabre@nondot.org> fix 2xi16 to pass as i32 instead of <2 x i16>. The former passes in
memory (as required) the later now passes in an xmm register. This
fixes gcc.dg/compat/vector_1 on x86-32.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0fefa4175b0c9101564946f6a975ee9946c16d4b 26-Aug-2010 Chris Lattner <sabre@nondot.org> vector of long and ulong are also classified as INTEGER in x86-64 abi,
this fixes rdar://8358475 a failure of the gcc.dg/compat/vector_1 abi
test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
473f8e723be93d84bd5fd15b094f4184802d4676 26-Aug-2010 Chris Lattner <sabre@nondot.org> 1 x ulonglong needs to be classified as INTEGER, just like 1 x longlong,
this fixes a miscompilation on the included testcase, rdar://8359248


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a8b7a7d3eaa51dd200cba1e5541f2542d24d7a6e 26-Aug-2010 Chris Lattner <sabre@nondot.org> tame an assertion, fixing rdar://8357396


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
22fd4baf2eba2103e2b41e463f1a5f6486c398fb 26-Aug-2010 Chris Lattner <sabre@nondot.org> Finally pass "two floats in a 64-bit unit" as a <2 x float> instead of
as a double in the x86-64 ABI. This allows us to generate much better
code for certain things, e.g.:

_Complex float f32(_Complex float A, _Complex float B) {
return A+B;
}

Used to compile into (look at the integer silliness!):

_f32: ## @f32
## BB#0: ## %entry
movd %xmm1, %rax
movd %eax, %xmm1
movd %xmm0, %rcx
movd %ecx, %xmm0
addss %xmm1, %xmm0
movd %xmm0, %edx
shrq $32, %rax
movd %eax, %xmm0
shrq $32, %rcx
movd %ecx, %xmm1
addss %xmm0, %xmm1
movd %xmm1, %eax
shlq $32, %rax
addq %rdx, %rax
movd %rax, %xmm0
ret

Now we get:

_f32: ## @f32
movdqa %xmm0, %xmm2
addss %xmm1, %xmm2
pshufd $16, %xmm2, %xmm2
pshufd $1, %xmm1, %xmm1
pshufd $1, %xmm0, %xmm0
addss %xmm1, %xmm0
pshufd $16, %xmm0, %xmm1
movdqa %xmm2, %xmm0
unpcklps %xmm1, %xmm0
ret

and compile stuff like:

extern float _Complex ccoshf( float _Complex ) ;
float _Complex ccosf ( float _Complex z ) {
float _Complex iz;
(__real__ iz) = -(__imag__ z);
(__imag__ iz) = (__real__ z);
return ccoshf(iz);
}

into:

_ccosf: ## @ccosf
## BB#0: ## %entry
pshufd $1, %xmm0, %xmm1
xorps LCPI4_0(%rip), %xmm1
unpcklps %xmm0, %xmm1
movaps %xmm1, %xmm0
jmp _ccoshf ## TAILCALL

instead of:

_ccosf: ## @ccosf
## BB#0: ## %entry
movd %xmm0, %rax
movq %rax, %rcx
shlq $32, %rcx
shrq $32, %rax
xorl $-2147483648, %eax ## imm = 0xFFFFFFFF80000000
addq %rcx, %rax
movd %rax, %xmm0
jmp _ccoshf ## TAILCALL


There is still "stuff to be done" here for the struct case,
but this resolves rdar://6379669 - [x86-64 ABI] Pass and return
_Complex float / double efficiently



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8bea82f6699e4384ef823cdc8800ad5db271177c 25-Aug-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix horrible white space errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
d608cdb7c044365cf4e8764ade1e11e99c176078 22-Aug-2010 John McCall <rjmccall@apple.com> Experiment with using first-class aggregates to represent member function
pointers. I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
117e3f4cd4d6ea41c3202da8729f94168c5c8239 30-Jul-2010 Chris Lattner <sabre@nondot.org> fix PR5179 and correctly fix PR5831 to not miscompile.

The X86-64 ABI code didn't handle the case when a struct
would get classified and turn up as "NoClass INTEGER" for
example. This is perfectly possible when the first slot
is all padding (e.g. due to empty base classes). In this
situation, the first 8-byte doesn't take a register at all,
only the second 8-byte does.

This fixes this by enhancing the x86-64 abi stuff to allow
and handle this case, reverts the broken fix for PR5831,
and enhances the target independent stuff to be able to
handle an argument value in registers being accessed at an
offset from the memory value.

This is the last x86-64 calling convention related miscompile
that I'm aware of.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
eb518b4b89e4134b21975530809697142f69b779 29-Jul-2010 Chris Lattner <sabre@nondot.org> move the last hunk of getCoerceResult into the place
that needs it and remove getCoerceResult.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
1cce1958b127f1722a18825b2cd793ce21246911 29-Jul-2010 Chris Lattner <sabre@nondot.org> now that direct and coerce are merged, getCoerceResult gets simpler.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
1b32ae9537186c021409bebeaa308db886ed98a2 29-Jul-2010 Chris Lattner <sabre@nondot.org> now that GetSSETypeAtOffset handles passing SSE class values as
float, the special case hack in getCoerceResult can go away.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0b3620066bfbb33004bed1816c851a923b9301af 29-Jul-2010 Chris Lattner <sabre@nondot.org> Implement the clang-side of detection for when to pass as
<2 x float> instead of double. This works but can't be turned
on until I teach codegen to pass <2 x float> as one XMM register
instead of two.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
cba8d310163f84630fd140fbfa9b6fdad9d26587 29-Jul-2010 Chris Lattner <sabre@nondot.org> Look at me, I can count!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
f47c944b5710a545d564b4d4b641a2f8bac96af3 29-Jul-2010 Chris Lattner <sabre@nondot.org> fix rdar://8251384, another case where we could access beyond the
end of a struct. This improves the case when the struct being passed
contains 3 floats, either due to a struct or array of 3 things. Before
we'd generate this IR for the testcase:

define float @bar(double %X.coerce0, double %X.coerce1) nounwind {
entry:
%X = alloca %struct.foof, align 8 ; <%struct.foof*> [#uses=2]
%0 = bitcast %struct.foof* %X to %1* ; <%1*> [#uses=2]
%1 = getelementptr %1* %0, i32 0, i32 0 ; <double*> [#uses=1]
store double %X.coerce0, double* %1
%2 = getelementptr %1* %0, i32 0, i32 1 ; <double*> [#uses=1]
store double %X.coerce1, double* %2
%tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1]
%tmp1 = load float* %tmp ; <float> [#uses=1]
ret float %tmp1
}

which compiled (with optimization) to:

_bar: ## @bar
## BB#0: ## %entry
movd %xmm1, %rax
movd %eax, %xmm0
ret

Now we produce:

define float @bar(double %X.coerce0, float %X.coerce1) nounwind {
entry:
%X = alloca %struct.foof, align 8 ; <%struct.foof*> [#uses=2]
%0 = bitcast %struct.foof* %X to %0* ; <%0*> [#uses=2]
%1 = getelementptr %0* %0, i32 0, i32 0 ; <double*> [#uses=1]
store double %X.coerce0, double* %1
%2 = getelementptr %0* %0, i32 0, i32 1 ; <float*> [#uses=1]
store float %X.coerce1, float* %2
%tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1]
%tmp1 = load float* %tmp ; <float> [#uses=1]
ret float %tmp1
}

and:

_bar: ## @bar
## BB#0: ## %entry
movaps %xmm1, %xmm0
ret



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
603519d269d48dca99927f0ad65e92099bd76161 29-Jul-2010 Chris Lattner <sabre@nondot.org> start setting up infrastructure for passing multi-floats
as <2 x float> instead of as double. The backend isn't ready
yet, but infrastructure in the frontend can come up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0d2656d77053cc2ed6f3a3acdf12d67807c7f3a2 29-Jul-2010 Chris Lattner <sabre@nondot.org> rename Get8ByteTypeAtOffset -> GetINTEGERTypeAtOffset to
make it clear that this function should only return a type
that the codegen will classify the same as an INTEGER type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9e45a3de3f462785a86bba77dee168ab354d9704 29-Jul-2010 Chris Lattner <sabre@nondot.org> handle a case where we could access off the end of a function
that Eli pointed out, rdar://8249586


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a7206c5367c2e5879fe6d9a07ed50aa003a56976 29-Jul-2010 Chris Lattner <sabre@nondot.org> fix PR7742 / rdar://8250764, a miscompilation of struct
return where the struct has a base but no fields. This
was because the x86-64 abi logic was checking the wrong
predicate in one place.

This was introduced in r91874, which was a fix for PR5831,
which lacked a CHECK line, so I verified and added it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
021c3a349d4f55cc2c7970268758bcf37b924493 29-Jul-2010 Chris Lattner <sabre@nondot.org> This is a little bit far, but optimize cases like:

struct a {
struct c {
double x;
int y;
} x[1];
};

void foo(struct a A) {
}

into:

define void @foo(double %A.coerce0, i32 %A.coerce1) nounwind {
entry:
%A = alloca %struct.a, align 8 ; <%struct.a*> [#uses=1]
%0 = bitcast %struct.a* %A to %struct.c* ; <%struct.c*> [#uses=2]
%1 = getelementptr %struct.c* %0, i32 0, i32 0 ; <double*> [#uses=1]
store double %A.coerce0, double* %1
%2 = getelementptr %struct.c* %0, i32 0, i32 1 ; <i32*> [#uses=1]
store i32 %A.coerce1, i32* %2

instead of:

define void @foo(double %A.coerce0, i64 %A.coerce1) nounwind {
entry:
%A = alloca %struct.a, align 8 ; <%struct.a*> [#uses=1]
%0 = bitcast %struct.a* %A to %0* ; <%0*> [#uses=2]
%1 = getelementptr %0* %0, i32 0, i32 0 ; <double*> [#uses=1]
store double %A.coerce0, double* %1
%2 = getelementptr %0* %0, i32 0, i32 1 ; <i64*> [#uses=1]
store i64 %A.coerce1, i64* %2

I only do this now because I never want to look at this code again :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
e2962be11e8894329d37985eccaa4f4a12dea402 29-Jul-2010 Chris Lattner <sabre@nondot.org> implement a todo: pass a eight-byte that consists of a
small integer + padding as that small integer. On code
like:

struct c { double x; int y; };
void bar(struct c C) { }

This means that we compile to:

define void @bar(double %C.coerce0, i32 %C.coerce1) nounwind {
entry:
%C = alloca %struct.c, align 8 ; <%struct.c*> [#uses=2]
%0 = getelementptr %struct.c* %C, i32 0, i32 0 ; <double*> [#uses=1]
store double %C.coerce0, double* %0
%1 = getelementptr %struct.c* %C, i32 0, i32 1 ; <i32*> [#uses=1]
store i32 %C.coerce1, i32* %1

instead of:

define void @bar(double %C.coerce0, i64 %C.coerce1) nounwind {
entry:
%C = alloca %struct.c, align 8 ; <%struct.c*> [#uses=3]
%0 = bitcast %struct.c* %C to %0* ; <%0*> [#uses=2]
%1 = getelementptr %0* %0, i32 0, i32 0 ; <double*> [#uses=1]
store double %C.coerce0, double* %1
%2 = getelementptr %0* %0, i32 0, i32 1 ; <i64*> [#uses=1]
store i64 %C.coerce1, i64* %2

which gives SRoA heartburn.

This implements rdar://5711709, a nice low number :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
800588fd230d2c37ddce8fbf4a3881352715d700 29-Jul-2010 Chris Lattner <sabre@nondot.org> Kill off the 'coerce' ABI passing form. Now 'direct' and 'extend' always
have a "coerce to" type which often matches the default lowering of Clang
type to LLVM IR type, but the coerce case can be handled by making them
not be the same.

This simplifies things and fixes issues where X86-64 abi lowering would
return coerce after making preferred types exactly match up. This caused
us to compile:

typedef float v4f32 __attribute__((__vector_size__(16)));
v4f32 foo(v4f32 X) {
return X+X;
}

into this code at -O0:

define <4 x float> @foo(<4 x float> %X.coerce) nounwind {
entry:
%retval = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
%coerce = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
%X.addr = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
store <4 x float> %X.coerce, <4 x float>* %coerce
%X = load <4 x float>* %coerce ; <<4 x float>> [#uses=1]
store <4 x float> %X, <4 x float>* %X.addr
%tmp = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1]
%tmp1 = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1]
%add = fadd <4 x float> %tmp, %tmp1 ; <<4 x float>> [#uses=1]
store <4 x float> %add, <4 x float>* %retval
%0 = load <4 x float>* %retval ; <<4 x float>> [#uses=1]
ret <4 x float> %0
}

Now we get:

define <4 x float> @foo(<4 x float> %X) nounwind {
entry:
%X.addr = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
store <4 x float> %X, <4 x float>* %X.addr
%tmp = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1]
%tmp1 = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1]
%add = fadd <4 x float> %tmp, %tmp1 ; <<4 x float>> [#uses=1]
ret <4 x float> %add
}

This implements rdar://8248065



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
15842bd05bd6d3b7450385ac8f73aaee5f807e19 29-Jul-2010 Chris Lattner <sabre@nondot.org> ignore structs that wrap vectors in IR, the abstraction shouldn't add penalty.

Before we'd compile the example into something like:

%coerce.dive2 = getelementptr %struct.v4f32wrapper* %retval, i32 0, i32 0 ; <<4 x float>*> [#uses=1]
%1 = bitcast <4 x float>* %coerce.dive2 to <2 x double>* ; <<2 x double>*> [#uses=1]
%2 = load <2 x double>* %1, align 1 ; <<2 x double>> [#uses=1]
ret <2 x double> %2

Now we produce:

%coerce.dive2 = getelementptr %struct.v4f32wrapper* %retval, i32 0, i32 0 ; <<4 x float>*> [#uses=1]
%0 = load <4 x float>* %coerce.dive2, align 1 ; <<4 x float>> [#uses=1]
ret <4 x float> %0



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0f408f5242522cbede304472e17931357c1b573d 29-Jul-2010 Chris Lattner <sabre@nondot.org> move the 'pretty 16-byte vector' inferring code up to be shared
with return values, improving stuff that returns __m128 etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
fe12d1ee8be8b8023c0c60b299ae957ea0df5d21 29-Jul-2010 Chris Lattner <sabre@nondot.org> simplify code by eliminating a premature optimization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109730 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
4711cb065922d46bfe80383b2001ae681f74780a 29-Jul-2010 Chris Lattner <sabre@nondot.org> now that we have CGT around, we can start using preferred types
for return values too. Instead of compiling something like:

struct foo {
int *X;
float *Y;
};

struct foo test(struct foo *P) { return *P; }

to:

%1 = type { i64, i64 }

define %1 @test(%struct.foo* %P) nounwind {
entry:
%retval = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=2]
%P.addr = alloca %struct.foo*, align 8 ; <%struct.foo**> [#uses=2]
store %struct.foo* %P, %struct.foo** %P.addr
%tmp = load %struct.foo** %P.addr ; <%struct.foo*> [#uses=1]
%tmp1 = bitcast %struct.foo* %retval to i8* ; <i8*> [#uses=1]
%tmp2 = bitcast %struct.foo* %tmp to i8* ; <i8*> [#uses=1]
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 16, i32 8, i1 false)
%0 = bitcast %struct.foo* %retval to %1* ; <%1*> [#uses=1]
%1 = load %1* %0, align 1 ; <%1> [#uses=1]
ret %1 %1
}

We now get the result more type safe, with:

define %struct.foo @test(%struct.foo* %P) nounwind {
entry:
%retval = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=2]
%P.addr = alloca %struct.foo*, align 8 ; <%struct.foo**> [#uses=2]
store %struct.foo* %P, %struct.foo** %P.addr
%tmp = load %struct.foo** %P.addr ; <%struct.foo*> [#uses=1]
%tmp1 = bitcast %struct.foo* %retval to i8* ; <i8*> [#uses=1]
%tmp2 = bitcast %struct.foo* %tmp to i8* ; <i8*> [#uses=1]
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 16, i32 8, i1 false)
%0 = load %struct.foo* %retval ; <%struct.foo> [#uses=1]
ret %struct.foo %0
}

That memcpy is completely terrible, but I don't know how to fix it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
5868ca2eb7f00d815f62e46f5a171eb6e5f91b5b 29-Jul-2010 Chris Lattner <sabre@nondot.org> sink preferred type stuff lower. It's possible that this might
improve codegen for vaarg or something, because its codepath is
getting preferred types now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ee5dcd064a811edc90f6c1fb31a837b6c961fed7 29-Jul-2010 Chris Lattner <sabre@nondot.org> dissolve some more complexity: make the x86-64 abi lowering code
compute its own preferred types instead of having CGT compute
them then pass them (circuituously) down into ABIInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
44f0fd2804e9952a8dbf85bb60ee3501aa9f5ee7 29-Jul-2010 Chris Lattner <sabre@nondot.org> simplify Get8ByteTypeAtOffset by making it a member of X86_64ABIInfo


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a3c109bbf6e198f463fbe204da4d25b40dab65c4 29-Jul-2010 Chris Lattner <sabre@nondot.org> now that ABIInfo depends on CGT, it has trivial access to such
things as TargetData, ASTContext, LLVMContext etc. Stop passing
them through so many APIs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ea0443212e7ec6ff82e2f174e8e948a6eb0e0876 29-Jul-2010 Chris Lattner <sabre@nondot.org> cave in to reality and make ABIInfo depend on CodeGenTypes.

This will simplify a bunch of code, coming up next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ab5722e67794b3954c874a369086fc5f41ac46a5 29-Jul-2010 Chris Lattner <sabre@nondot.org> pass argument vectors in a type that corresponds to the user type if
possible. This improves the example to pass <4 x float> instead of
<2 x double> but we still get awful code, and still don't get the
return value right.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0b30c67132f00c667512a65cfe1fe81ae54c2383 29-Jul-2010 Chris Lattner <sabre@nondot.org> fix some break statements to be formatted more consistently,
remove some now-dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
519f68cd26777c755763a644a7f7ed7ac389beb9 29-Jul-2010 Chris Lattner <sabre@nondot.org> use Get8ByteTypeAtOffset for the return value path as well so we
don't get errors similar to PR7714 on the return path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
49382de42c2a411bfd772408e987cb399071241d 29-Jul-2010 Chris Lattner <sabre@nondot.org> refactor the autosizing code, eliminating duplication
and making Get8ByteTypeAtOffset always succeed and documented.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
1daf808a48d26328dd31a3275ce599cee326c957 29-Jul-2010 Chris Lattner <sabre@nondot.org> fix PR7714 by not referencing off the end of a struct when passed by value in
x86-64 abi. This also improves codegen as well. Some refactoring is needed of
this code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
3852f34eaa50908debfa03b450b3e68376efd852 15-Jul-2010 Daniel Dunbar <daniel@zuster.org> CodeGen: Tweak ABI handling for Minix, patch by Kees van Reeuwijk!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
38e317d6dce161b249508686cc67eb7176958762 07-Jul-2010 Chris Lattner <sabre@nondot.org> add driver support for minix, patch by Kees van Reeuwijk
from PR7583


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
bcaedaed309ce453a992fdeef4a4c908cc7d9dfb 30-Jun-2010 Chris Lattner <sabre@nondot.org> Reapply:
r107173, "fix PR7519: after thrashing around and remembering how all this stuff"
r107216, "fix PR7523, which was caused by the ABI code calling ConvertType instead"

This includes a fix to make ConvertTypeForMem handle the "recursive" case, and call
it as such when lowering function types which have an indirect result.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107310 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
7bbe03d8ae0772d89f6539d073dd43e49268a42c 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> Revert r107173, "fix PR7519: after thrashing around and remembering how all this stuff", it broke bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107232 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
376fe5e7800dface235c5382b39d77790d39dfa7 29-Jun-2010 Chris Lattner <sabre@nondot.org> fix PR7519: after thrashing around and remembering how all this stuff
works, the fix is quite simple: just make sure to call ConvertTypeRecursive
when the function type being lowered is in the midst of ConvertType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9c254f0415bef9a0bafe5b5026ddb54b727597b1 29-Jun-2010 Chris Lattner <sabre@nondot.org> Change X86_64ABIInfo to have ASTContext and TargetData ivars to
avoid passing ASTContext down through all the methods it has.

When classifying an argument, or argument piece, as INTEGER, check
to see if we have a pointer at exactly the same offset in the
preferred type. If so, use that pointer type instead of i64. This
allows us to compile A function taking a stringref into something
like this:

define i8* @foo(i64 %D.coerce0, i8* %D.coerce1) nounwind ssp {
entry:
%D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=4]
%0 = getelementptr %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1]
store i64 %D.coerce0, i64* %0
%1 = getelementptr %struct.DeclGroup* %D, i32 0, i32 1 ; <i8**> [#uses=1]
store i8* %D.coerce1, i8** %1
%tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1]
%tmp1 = load i64* %tmp ; <i64> [#uses=1]
%tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i8**> [#uses=1]
%tmp3 = load i8** %tmp2 ; <i8*> [#uses=1]
%add.ptr = getelementptr inbounds i8* %tmp3, i64 %tmp1 ; <i8*> [#uses=1]
ret i8* %add.ptr
}

instead of this:

define i8* @foo(i64 %D.coerce0, i64 %D.coerce1) nounwind ssp {
entry:
%D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=3]
%0 = insertvalue %0 undef, i64 %D.coerce0, 0 ; <%0> [#uses=1]
%1 = insertvalue %0 %0, i64 %D.coerce1, 1 ; <%0> [#uses=1]
%2 = bitcast %struct.DeclGroup* %D to %0* ; <%0*> [#uses=1]
store %0 %1, %0* %2, align 1
%tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1]
%tmp1 = load i64* %tmp ; <i64> [#uses=1]
%tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i8**> [#uses=1]
%tmp3 = load i8** %tmp2 ; <i8*> [#uses=1]
%add.ptr = getelementptr inbounds i8* %tmp3, i64 %tmp1 ; <i8*> [#uses=1]
ret i8* %add.ptr
}

This implements rdar://7375902 - [codegen quality] clang x86-64 ABI lowering code punishing StringRef



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a159c2e83942b7dae64457d4fff265bb74550cac 29-Jun-2010 Chris Lattner <sabre@nondot.org> plumb preferred types down into X86_64ABIInfo::classifyArgumentType,
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8640cd6bf077e007fdb9bc8c9c5e319f7d70da96 29-Jun-2010 Chris Lattner <sabre@nondot.org> Pass the LLVM IR version of argument types down into computeInfo.
This is somewhat annoying to do this at this level, but it avoids
having ABIInfo know depend on CodeGenTypes for a hint.

Nothing is using this yet, so no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
8ff296496de0970c8d6d72320a1427a926d7ef14 28-Jun-2010 Chris Lattner <sabre@nondot.org> pass/return structs of char and short as i8/i16 to avoid
aweful through-memory coersion, just like we do for i32 now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
1090a9ba0902380dbd97d0a500daa4c373712df9 28-Jun-2010 Chris Lattner <sabre@nondot.org> more tidying up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
dce5ad0cf70ba74e1ecdbb5e81f1a81d97821636 28-Jun-2010 Chris Lattner <sabre@nondot.org> random acts of tidying.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
faf23b72f171ef997d48c453a5a4783c5759f8fe 28-Jun-2010 Chris Lattner <sabre@nondot.org> X86-64:
pass/return structs of float/int as float/i32 instead of double/i64
to make the code generated for ABI cleaner. Passing in the low part
of a double is the same as passing in a float.

For example, we now compile:

struct DeclGroup { float NumDecls; };
float foo(DeclGroup D);
void bar(DeclGroup *D) {
foo(*D);
}

into:

%struct.DeclGroup = type { float }

define void @_Z3barP9DeclGroup(%struct.DeclGroup* %D) nounwind {
entry:
%D.addr = alloca %struct.DeclGroup*, align 8 ; <%struct.DeclGroup**> [#uses=2]
%agg.tmp = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2]
store %struct.DeclGroup* %D, %struct.DeclGroup** %D.addr
%tmp = load %struct.DeclGroup** %D.addr ; <%struct.DeclGroup*> [#uses=1]
%tmp1 = bitcast %struct.DeclGroup* %agg.tmp to i8* ; <i8*> [#uses=1]
%tmp2 = bitcast %struct.DeclGroup* %tmp to i8* ; <i8*> [#uses=1]
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 4, i32 4, i1 false)
%coerce.dive = getelementptr %struct.DeclGroup* %agg.tmp, i32 0, i32 0 ; <float*> [#uses=1]
%0 = load float* %coerce.dive, align 1 ; <float> [#uses=1]
%call = call float @_Z3foo9DeclGroup(float %0) ; <float> [#uses=0]
ret void
}

instead of:

%struct.DeclGroup = type { float }

define void @_Z3barP9DeclGroup(%struct.DeclGroup* %D) nounwind {
entry:
%D.addr = alloca %struct.DeclGroup*, align 8 ; <%struct.DeclGroup**> [#uses=2]
%agg.tmp = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2]
%tmp3 = alloca double ; <double*> [#uses=2]
store %struct.DeclGroup* %D, %struct.DeclGroup** %D.addr
%tmp = load %struct.DeclGroup** %D.addr ; <%struct.DeclGroup*> [#uses=1]
%tmp1 = bitcast %struct.DeclGroup* %agg.tmp to i8* ; <i8*> [#uses=1]
%tmp2 = bitcast %struct.DeclGroup* %tmp to i8* ; <i8*> [#uses=1]
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 4, i32 4, i1 false)
%coerce.dive = getelementptr %struct.DeclGroup* %agg.tmp, i32 0, i32 0 ; <float*> [#uses=1]
%0 = bitcast double* %tmp3 to float* ; <float*> [#uses=1]
%1 = load float* %coerce.dive ; <float> [#uses=1]
store float %1, float* %0, align 1
%2 = load double* %tmp3 ; <double> [#uses=1]
%call = call float @_Z3foo9DeclGroup(double %2) ; <float> [#uses=0]
ret void
}

which is this machine code (at -O0):

__Z3barP9DeclGroup:
subq $24, %rsp
movq %rdi, 16(%rsp)
movq 16(%rsp), %rdi
leaq 8(%rsp), %rax
movl (%rdi), %ecx
movl %ecx, (%rax)
movss 8(%rsp), %xmm0
callq __Z3foo9DeclGroup
addq $24, %rsp
ret

vs this:

__Z3barP9DeclGroup:
subq $24, %rsp
movq %rdi, 16(%rsp)
movq 16(%rsp), %rdi
leaq 8(%rsp), %rax
movl (%rdi), %ecx
movl %ecx, (%rax)
movss 8(%rsp), %xmm0
movss %xmm0, (%rsp)
movsd (%rsp), %xmm0
callq __Z3foo9DeclGroup
addq $24, %rsp
ret

At -O3, it is the difference between this now:

__Z3barP9DeclGroup:
movss (%rdi), %xmm0
jmp __Z3foo9DeclGroup # TAILCALL

vs this before:

__Z3barP9DeclGroup:
movl (%rdi), %eax
movd %rax, %xmm0
jmp __Z3foo9DeclGroup # TAILCALL



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
77b89b87c3b9220fea1bc80f6d6598d2003cc8a8 27-Jun-2010 Chris Lattner <sabre@nondot.org> finally get around to doing a significant cleanup to irgen:
have CGF create and make accessible standard int32,int64 and
intptr types. This fixes a ton of 80 column violations
introduced by LLVMContextification and cleans up stuff a lot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
7f215c12af4c3e7f81b24102a676aabfdb4e1566 26-Jun-2010 Chris Lattner <sabre@nondot.org> use more efficient type comparison predicates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
1ed1a594e9befc91ebf00d81b41a2fdfab862657 16-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Change the test for which ABI/CC to use on ARM to be base on the environment
(the last argument of the triple).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
25117ab35c1a033846073183314c68ef07d1701a 16-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Don't set the calling convention for ARM if it is already the default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9d3347a5887d2d25afe8b0bd35783a72ec86cce2 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Give Type::isIntegralType() an ASTContext parameter, so that it
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++.

Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
2ade35e2cfd554e49d35a52047cea98a82787af9 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Introduce Type::isIntegralOrEnumerationType(), to cover those places
in C++ that involve both integral and enumeration types. Convert all
of the callers to Type::isIntegralType() that are meant to work with
both integral and enumeration types over to
Type::isIntegralOrEnumerationType(), to prepare to eliminate
enumeration types as integral types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0eb1d9733801764cd8b692c67e117e4feeecf013 08-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix passing and returning of objects with non trivial copy constructors on
ARM.

Fixes PR7310.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
aeeb7011a875d3dd439e9fa07dc3ac54d97785b9 27-May-2010 John McCall <rjmccall@apple.com> Implement __builtin_init_dwarf_reg_size_table and __builtin_dwarf_sp_column
for 32-bit MIPS processors. Hat-tip to rdivacky for providing gcc dumps
on this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
e32b9b854e5b92b223c553164d3ecfbf657dbbf2 17-May-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Remove dead function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
5ea68614bfe0e78b5d66339b781529038f86501f 17-May-2010 Daniel Dunbar <daniel@zuster.org> C++/Darwin/i386 ABI: Fix some problems with empty record handling.
- Check bases as part of isEmptyRecord().

- C++ record fields are never empty in the Itanium ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
67d438d39a1cc37c372a2684dc354f58d0169bb1 15-May-2010 Daniel Dunbar <daniel@zuster.org> C++/ABI/x86_64: Member pointers should be classified as INTEGER.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
7711523d948bbe635f690f5795ef7ea9a3289eb2 15-May-2010 Daniel Dunbar <daniel@zuster.org> C++/ABI/i386: Member function pointers should be passed by value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a1842d32a1964712e42078e9b389dce9258c6a8c 14-May-2010 Daniel Dunbar <daniel@zuster.org> C++/Darwin/x86: Teach IRgen it can pass reference types in registers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
9430d5a61598c47d827e1cd05f7cf3f110eeec9e 11-May-2010 Daniel Dunbar <daniel@zuster.org> IRgen/i386/C++: Fix isSingleElementStruct computation for C++ record decls.
- Fixes PR7098.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
46c54fb8ec45765a475b7b709b9aee7f94c490c2 21-Apr-2010 Daniel Dunbar <daniel@zuster.org> ABI/x86-32 & x86-64: Alignment on 'byval' must be set when when the alignment
exceeds the minimum ABI alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
dc6d574155072bfb35a7a29b94ef3afa0d40fb5a 21-Apr-2010 Daniel Dunbar <daniel@zuster.org> IRgen/x86-32: Factor out getIndirectResult(), to match x86-64 factoring.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
52d9ae3220c08fcbb80f213a364a88e4e0067242 06-Apr-2010 Chris Lattner <sabre@nondot.org> fit in 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a14db75641f377ef8b033c67653cd95ac4c36fe3 11-Mar-2010 Chris Lattner <sabre@nondot.org> fix PR6433, crash on va_arg of typedef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
ec853ba1087f606e9685cb1e800616565ba35093 11-Mar-2010 John McCall <rjmccall@apple.com> Support PPC-32 DWARF EH intrinisics. Thanks to rdivacky for his assistance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
6374c3307e2d73348f7b8cc73eeeb0998ad0ac94 06-Mar-2010 John McCall <rjmccall@apple.com> Implement __builtin_dwarf_sp_column for i386 (Darwin and not), x86-64 (all),
and ARM. Implement __builtin_init_dwarf_reg_size_table for i386 (both) and
x86-64 (all).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
0b0ef0a70b8010c66fad2603e4423ef1c1dc7015 24-Feb-2010 John McCall <rjmccall@apple.com> Canonicalize parameter and return types before computing ABI info. Eliminates
a common source of oddities and, in theory, removes some redundant ABI
computations. Also fixes a miscompile I introduced yesterday by refactoring
some code and causing a slightly different code path to be taken that
didn't perform *parameter* type canonicalization, just normal type
canonicalization; this in turn caused a bit of ABI code to misfire because
it was looking for 'double' or 'float' but received 'const float'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a446ecd13a9cd2c150baa5d3db4f817db4b1eba8 17-Feb-2010 Sanjiv Gupta <sanjiv.gupta@microchip.com> implement EmitVAArg. pretty much the same way other targets do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
f177d9d6c27fbbcee8c00fd90b8306985c03c54a 15-Feb-2010 Duncan Sands <baldrick@free.fr> Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
74f7293eb30bf77355c20a3c2cad7b67d8ce7388 13-Feb-2010 Charles Davis <cdavis@mines.edu> Emit the 'alignstack' LLVM function attribute when we encounter a function
marked 'force_align_arg_pointer'. Almost there; now all I need to do is finish
up the backend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
aa74a1e49f7c4b89539830290f76fe2c3e97187f 02-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement promotion for enumeration types.

WHAT!?!

It turns out that Type::isPromotableIntegerType() was not considering
enumeration types to be promotable, so we would never do the
promotion despite having properly computed the promotion type when the
enum was defined. Various operations on values of enum type just
"worked" because we could still compute the integer rank of an enum
type; the oddity, however, is that operations such as "add an enum and
an unsigned" would often have an enum result type (!). The bug
actually showed up as a spurious -Wformat diagnostic
(<rdar://problem/7595366>), but in theory it could cause miscompiles.

In this commit:
- Enum types with a promotion type of "int" or "unsigned int" are
promotable.
- Tweaked the computation of promotable types for enums
- For all of the ABIs, treat enum types the same way as their
underlying types (*not* their promotion types) for argument passing
and return values
- Extend the ABI tester with support for enumeration types



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
4581581881d3f7349bf5a4b39d761bce688f9164 02-Feb-2010 Daniel Dunbar <daniel@zuster.org> ARM/APCS: Fix classification of small complex integer types as "integer like".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
4cc753f4503931763cfb762a95928b44fcbe64e9 02-Feb-2010 Daniel Dunbar <daniel@zuster.org> ARM/APCS: Pass Complex types following llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
679855a6e14fbc6c6838c566aa74c32f52f4f946 29-Jan-2010 Daniel Dunbar <daniel@zuster.org> ARM/APCS ABI: Fix some problems with bit-fields in structures. After rereading
the ABI spec, this turns out to simplify the code. We still have some annoying
code which mismatches the spec with regard to empty structures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
a887423cf580e19b2d03e3a0499c065730c96b28 27-Jan-2010 Anders Carlsson <andersca@mac.com> Structs and classes with non-trivial destructors or copy constructors should be passed indirectly in the 32-bit ABI. Fixes PR6094.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
568bb2d3189108b6d510a6233d1e6e003a47cbdc 22-Jan-2010 Douglas Gregor <dgregor@apple.com> Eliminate some Clang warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
82d0a418c8699fc6f4a9417457ffe93d43bba1c1 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Generalize target weirdness handling having proper layering in mind:
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes

As a proof-of-concept - implement msp430's 'interrupt' attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp
82bac50fc0ab125ff5b4308ee91a731e3761eb63 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Rename file to generalization in next commits

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/TargetInfo.cpp