Akira Hatanaka
f093f5be3e
Have functions return structures smaller than 128-bit in registers if ABI
...
is either N32 or N64.
llvm-svn: 147520
2012-01-04 03:34:42 +00:00
Tony Linthicum
76329bf83f
Hexagon backend support
...
llvm-svn: 146413
2011-12-12 21:14:55 +00:00
Eli Friedman
b8e45b28da
Minor comment update.
...
llvm-svn: 145905
2011-12-06 03:08:26 +00:00
Eli Friedman
bfd5addf4c
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.
...
llvm-svn: 145652
2011-12-02 00:11:43 +00:00
Eli Friedman
f37bd2f2f1
Don't use a varargs convention for calls unprototyped functions where one of the arguments is an AVX vector.
...
llvm-svn: 145574
2011-12-01 04:53:19 +00:00
Tanya Lattner
71f1b2dcd4
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.
llvm-svn: 145312
2011-11-28 23:18:11 +00:00
Eli Friedman
f22fa9eaef
Finish r144971, which was an incomplete commit.
...
llvm-svn: 144972
2011-11-18 04:01:36 +00:00
Eli Friedman
0b3f201b61
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.
...
llvm-svn: 144971
2011-11-18 03:47:20 +00:00
Eli Friedman
a1748564b4
Make va_arg on x86-64 compute alignment the same way as argument passing.
...
Fixes <rdar://problem/10463281>.
llvm-svn: 144966
2011-11-18 02:44:19 +00:00
Eli Friedman
1d7dd3b682
A bunch of fixes to argument passing and va_arg on Darwin x86-32 for structures containing an SSE vector.
...
llvm-svn: 144963
2011-11-18 02:12:09 +00:00
Eli Friedman
e5c85622c9
Don't try to expand struct arguments containing holes on x86-32. From gcc struct layout tests.
...
llvm-svn: 144961
2011-11-18 01:32:26 +00:00
Eli Friedman
ee94534662
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.
...
llvm-svn: 144960
2011-11-18 01:25:50 +00:00
Eli Friedman
9f061a37bb
Ignore empty unions in argument lowering on x86-32. From gcc struct layout tests.
...
llvm-svn: 144944
2011-11-18 00:28:11 +00:00
Akira Hatanaka
f3879ee666
Use a single integer type for a sub-doubleword part of a byval structure.
...
llvm-svn: 143666
2011-11-03 23:31:00 +00:00
Jan Wen Voung
180319f72d
Do not add "byval" attribute to records with non-trivial copy constructors
...
and destructors in the DefaultABIInfo.
llvm-svn: 143601
2011-11-03 00:59:44 +00:00
Akira Hatanaka
756ce7f9ab
Set MinABIStackAlignInBytes to 8 if ABI is N32/64.
...
llvm-svn: 143597
2011-11-03 00:05:50 +00:00
Akira Hatanaka
101f70da7c
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.
llvm-svn: 143596
2011-11-02 23:54:49 +00:00
Akira Hatanaka
1437852c38
Return function results whose size is smaller than 128-bits in registers if ABI
...
is N32/64.
llvm-svn: 143589
2011-11-02 23:14:57 +00:00
Bob Wilson
1d9269a8d6
Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.
...
llvm-svn: 143530
2011-11-02 04:51:36 +00:00
Dan Gohman
53bb0ff685
Remove the SystemZ backend.
...
llvm-svn: 142879
2011-10-24 23:48:52 +00:00
Peter Collingbourne
adcf7c9203
TCE target: conversion of OpenCL reqd_work_group_size attr to metadata
...
Patch by Pekka Jääskeläinen!
llvm-svn: 141865
2011-10-13 16:24:41 +00:00
Richard Smith
caf3390d44
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.
llvm-svn: 141561
2011-10-10 18:28:20 +00:00
Ted Kremenek
c168e50722
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.
...
llvm-svn: 141479
2011-10-08 05:28:26 +00:00
Peter Collingbourne
5bad4afa2f
CUDA: set proper calling conventions for PTX
...
llvm-svn: 141296
2011-10-06 16:49:54 +00:00
Justin Holewinski
38031978b5
PTX: Set proper calling conventions for PTX in OpenCL mode.
...
llvm-svn: 141193
2011-10-05 17:58:44 +00:00
David Blaikie
aa347f9392
Removing a bunch of dead returns/breaks after llvm_unreachables.
...
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
David Blaikie
83d382b1ca
Switch assert(0/false) llvm_unreachable.
...
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
John McCall
cbc038a6c3
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.
llvm-svn: 140241
2011-09-21 08:08:30 +00:00
Akira Hatanaka
ec11b4fa5a
Create a MipsTargetCodeGenInfo object for mips64/mips64el. The size of the
...
UnwindException structure is 32 for mips64.
llvm-svn: 140165
2011-09-20 18:30:57 +00:00
Akira Hatanaka
0486db08bd
Add a parameter to MipsTargetCodeGenInfo's constructor.
...
llvm-svn: 140161
2011-09-20 18:23:28 +00:00
Douglas Gregor
e8bbc12152
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).
llvm-svn: 138985
2011-09-02 00:18:52 +00:00
John McCall
3480ef24d1
The size of struct UnwindException varies by platform with no
...
apparent general rule. Just special-case it as appropriate.
PR10789.
llvm-svn: 138792
2011-08-30 01:42:09 +00:00
Akira Hatanaka
ae31c7af1c
Alignment of a va_arg must be at least as large as the ABI's minimum alignment.
...
llvm-svn: 137420
2011-08-12 02:30:14 +00:00
Akira Hatanaka
dabfc21fbf
Add definition of a static member of a class.
...
llvm-svn: 137411
2011-08-12 01:43:14 +00:00
Bob Wilson
e826a2a56b
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.
llvm-svn: 136767
2011-08-03 05:58:22 +00:00
Rafael Espindola
11d994b769
Implements alignment for long long and double types in va_arg on ARM AAPCS.
...
Patch by Jim (Ningjie) Chen.
llvm-svn: 136734
2011-08-02 22:33:37 +00:00
Bob Wilson
8e2b75dbad
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
llvm-svn: 136662
2011-08-01 23:39:04 +00:00
Akira Hatanaka
fb1d9f325c
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
llvm-svn: 136647
2011-08-01 20:48:01 +00:00
Akira Hatanaka
df425dbf04
Pass records with non-trivial destructors or constructors indirectly.
...
llvm-svn: 136630
2011-08-01 18:09:58 +00:00
Chris Lattner
0e62c1cc0b
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
...
them into the clang namespace.
llvm-svn: 135852
2011-07-23 10:55:15 +00:00
Chris Lattner
2192fe50da
de-constify llvm::Type, patch by David Blaikie!
...
llvm-svn: 135370
2011-07-18 04:24:23 +00:00
Joerg Sonnenberger
4921fe2f9e
Fix typo
...
llvm-svn: 135285
2011-07-15 18:23:44 +00:00
Bruno Cardoso Lopes
98154a76fd
Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.
...
llvm-svn: 135091
2011-07-13 21:58:55 +00:00
Bruno Cardoso Lopes
0aadf83f80
Revert r134946
...
llvm-svn: 135004
2011-07-12 22:30:58 +00:00
Bruno Cardoso Lopes
37b7fd0ab2
Fix a typo!
...
llvm-svn: 134952
2011-07-12 02:47:38 +00:00
Bruno Cardoso Lopes
75541d00e0
Do the same as r134946 for arrays. Add more testcases for avx x86_64 arg
...
passing.
llvm-svn: 134951
2011-07-12 01:27:38 +00:00
Bruno Cardoso Lopes
7a26681092
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.
llvm-svn: 134946
2011-07-12 00:30:27 +00:00
Bruno Cardoso Lopes
21a41bb5ec
Reapply r134754, which turns out to be working correctly and also
...
add one more testcase.
llvm-svn: 134934
2011-07-11 22:41:29 +00:00
Jay Foad
7c57be3e2b
De-constify Types in StructType::get() and TargetData::getIntPtrType().
...
llvm-svn: 134893
2011-07-11 09:56:20 +00:00
Chris Lattner
a5f58b05e8
clang side to match the LLVM IR type system rewrite patch.
...
llvm-svn: 134831
2011-07-09 17:41:47 +00:00