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
Eli Friedman
3346582bca
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>
llvm-svn: 134770
2011-07-08 23:31:17 +00:00
Bruno Cardoso Lopes
129b4cc9ec
Revert x86_64 ABI changes until I have time to check the items raised by Eli.
...
llvm-svn: 134765
2011-07-08 22:57:35 +00:00
Bruno Cardoso Lopes
308d7423a9
Add support for AVX 256-bit in the x86_64 ABI (as in the 0.99.5 draft)
...
llvm-svn: 134754
2011-07-08 22:18:40 +00:00
Eli Friedman
1310c68bb0
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.
llvm-svn: 134300
2011-07-02 00:57:27 +00:00
Eli Friedman
4774b7e456
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".)
llvm-svn: 134059
2011-06-29 07:04:55 +00:00
NAKAMURA Takumi
5364847a84
De-Unicode-ify in comments.
...
llvm-svn: 133501
2011-06-21 03:19:28 +00:00
Chris Lattner
845511fe1c
update for api change.
...
llvm-svn: 133365
2011-06-18 22:49:11 +00:00
John McCall
31168b077c
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.
llvm-svn: 133103
2011-06-15 23:02:42 +00:00
Akira Hatanaka
b579fe5f15
Add stuff for o32 ABI conformance.
...
llvm-svn: 132443
2011-06-02 00:09:17 +00:00
Chris Lattner
e76b95ae15
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.
llvm-svn: 131881
2011-05-22 23:35:00 +00:00
Chris Lattner
44c2b90556
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.
llvm-svn: 131879
2011-05-22 23:21:23 +00:00
Roman Divacky
c161735bdf
Add ARMTargetCodeGenInfo::initDwarfEHRegSizeTable() defining 16 32bit regs.
...
llvm-svn: 131558
2011-05-18 19:36:54 +00:00
Argyrios Kyrtzidis
d42411fa19
Revert r131447, see if it fixes the buildbot.
...
llvm-svn: 131450
2011-05-17 02:17:52 +00:00
Argyrios Kyrtzidis
ceee5e8133
Inside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit.
...
llvm-svn: 131447
2011-05-17 00:46:40 +00:00
Stuart Hastings
9f02fd9d8d
Raise ARM byval minimum size from 32 to 64, addressing a performance
...
regression in mason. rdar://problem/7662569
llvm-svn: 130444
2011-04-28 21:35:59 +00:00
Stuart Hastings
dd77c8efa2
Replace unitary array with scalar. rdar://problem/7662569
...
llvm-svn: 130423
2011-04-28 19:24:47 +00:00
Stuart Hastings
4b21495e42
Replace SmallVector with an array, as suggested by Frits van Bommel. rdar://problem/7662569
...
llvm-svn: 130417
2011-04-28 18:16:06 +00:00
Stuart Hastings
f2752a3938
Re-enable byval for ARM in clang. rdar://problem/7662569
...
llvm-svn: 130312
2011-04-27 17:24:02 +00:00
Eric Christopher
6f095d613a
Temporarily revert r130176, it appears to have broken a few tests.
...
llvm-svn: 130179
2011-04-26 01:02:04 +00:00
Stuart Hastings
83da03c2ab
Turn on byval parameters in Clang for ARM APCS. rdar://problem/7662569
...
llvm-svn: 130176
2011-04-25 23:48:12 +00:00
Justin Holewinski
bd4a3c03ff
PTX: Add default PTX calling conventions
...
llvm-svn: 129987
2011-04-22 11:10:38 +00:00
John McCall
e0fda7377e
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.
llvm-svn: 129899
2011-04-21 01:20:55 +00:00
Daniel Dunbar
14ad22f09d
ADT/Triple: Switch to using .isOSDarwin() predicate.
...
llvm-svn: 129823
2011-04-19 21:43:27 +00:00
Chris Lattner
57540c5be0
fix a bunch of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Anton Korobeynikov
231e875b5c
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.
llvm-svn: 129534
2011-04-14 20:06:49 +00:00
Sandeep Patel
45df3dd3fe
Set AAPCS-VFP calling convention accordingly and hard float ABI command handling.
...
llvm-svn: 128866
2011-04-05 00:23:47 +00:00
Jay Foad
20c0f02cc5
Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
...
PHINode::Create() giving the (known or expected) number of operands.
llvm-svn: 128538
2011-03-30 11:28:58 +00:00
Bill Wendling
ec9d2633f1
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.
llvm-svn: 127185
2011-03-07 22:47:14 +00:00
Tilmann Scheller
99cc30c371
Revert "Add CC_Win64ThisCall and set it in the necessary places."
...
This reverts commit 126863.
llvm-svn: 126886
2011-03-02 21:36:49 +00:00
Tilmann Scheller
454464b491
Add CC_Win64ThisCall and set it in the necessary places.
...
llvm-svn: 126863
2011-03-02 19:36:23 +00:00
NAKAMURA Takumi
f8a6e802f9
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.
llvm-svn: 126186
2011-02-22 03:56:57 +00:00
Peter Collingbourne
8f5cf74c77
Re-instate r125819 and r125820 with no functionality change
...
llvm-svn: 126060
2011-02-19 23:03:58 +00:00
Rafael Espindola
a6d2bff0c5
Revert 125820 and 125819 to fix PR9266.
...
llvm-svn: 126050
2011-02-19 21:39:31 +00:00
Peter Collingbourne
3ae6caaf1b
Move TargetInfo::adjustInlineAsmType to TargetCodeGenInfo
...
llvm-svn: 125819
2011-02-18 02:24:56 +00:00
NAKAMURA Takumi
31ea2f14bc
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.
llvm-svn: 125742
2011-02-17 08:51:38 +00:00
NAKAMURA Takumi
029d74b264
Fix whitespace.
...
llvm-svn: 125741
2011-02-17 08:50:50 +00:00
Benjamin Kramer
24f1d3e60a
Add NetBSD target support. Patch by Joerg Sonnenberger.
...
llvm-svn: 124736
2011-02-02 18:59:27 +00:00
NAKAMURA Takumi
e03c603624
lib/CodeGen/TargetInfo.cpp: Fix coding style and erase an obsolete comment.
...
llvm-svn: 123790
2011-01-19 00:11:33 +00:00
NAKAMURA Takumi
bd91f50190
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}.
llvm-svn: 123692
2011-01-17 22:56:31 +00:00
Bob Wilson
b9fa00e0c2
Remove special handling for opaque Neon vector types.
...
Clang does not wrap the vectors in structs anymore so this isn't needed.
llvm-svn: 123241
2011-01-11 16:53:49 +00:00
Bob Wilson
bd4520b535
Move DefaultABIInfo::classifyReturnType where it belongs. No functional change.
...
llvm-svn: 123195
2011-01-10 23:54:17 +00:00
Wesley Peck
36a1f68fec
1. Add some ABI information for the Microblaze.
...
2. Add attibutes "interrupt_handler" and "save_volatiles" for the Microblaze target.
llvm-svn: 122184
2010-12-19 19:57:51 +00:00
Benjamin Kramer
8c173cc364
Use a twine.
...
llvm-svn: 118892
2010-11-12 15:42:18 +00:00
Anders Carlsson
fd88a6160d
Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.
...
llvm-svn: 117881
2010-10-31 23:22:37 +00:00
Michael J. Spencer
f5a1fbcdf3
Fix Whitespace.
...
llvm-svn: 116798
2010-10-19 06:39:39 +00:00
Bill Wendling
9987c0ea42
We shouldn't keep track of MMX registers "needed" separately from the SSE
...
registers needed.
llvm-svn: 116772
2010-10-18 23:51:38 +00:00
Bill Wendling
5cd41c4b13
Reapply r116684 with fixes. The test cases needed to be updated.
...
llvm-svn: 116696
2010-10-18 03:41:31 +00:00
Bill Wendling
c7c9be661f
Temporarily revert r116684. It was causing failures with
...
Clang :: CodeGen/x86_32-arguments-darwin.c
Clang :: CodeGen/x86_32-arguments-linux.c
llvm-svn: 116687
2010-10-17 07:58:46 +00:00
Bill Wendling
812f4b123e
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.
llvm-svn: 116684
2010-10-17 07:38:01 +00:00
Chris Lattner
a09e8efd1f
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.
llvm-svn: 116191
2010-10-11 05:44:49 +00:00
Daniel Dunbar
19964dbe3b
IRgen/ABI/ARM: Return large vectors in memory.
...
llvm-svn: 114619
2010-09-23 01:54:32 +00:00
Daniel Dunbar
b34b08098c
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).
llvm-svn: 114618
2010-09-23 01:54:28 +00:00
Daniel Dunbar
dd38fbc7fb
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.
llvm-svn: 114115
2010-09-16 20:42:06 +00:00
Daniel Dunbar
7b7c2937ef
IRgen/ABI: Add support for realigning structures which are passed by indirect
...
reference.
llvm-svn: 114114
2010-09-16 20:42:02 +00:00
Daniel Dunbar
ed23de3348
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.
llvm-svn: 114113
2010-09-16 20:42:00 +00:00
Daniel Dunbar
8a6c91ff76
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.
llvm-svn: 114112
2010-09-16 20:41:56 +00:00