Seth Cantrell
6255c257e9
Add and update tests for character literals
...
llvm-svn: 148392
2012-01-18 12:27:10 +00:00
Nick Lewycky
e2367d2508
Add testcase for r148375!
...
llvm-svn: 148378
2012-01-18 04:28:31 +00:00
Tanya Lattner
81ce08c983
Add new line.
...
llvm-svn: 148255
2012-01-16 21:15:33 +00:00
Tanya Lattner
20248226a9
Add support for OpenCL 1.1 logical operations.
...
llvm-svn: 148254
2012-01-16 21:02:28 +00:00
David Chisnall
fa35df628a
Some improvements to the handling of C11 atomic types:
...
- Add atomic-to/from-nonatomic cast types
- Emit atomic operations for arithmetic on atomic types
- Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load
- Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function.
- Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it.
Still to do:
- Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg.
- Add a signal fence builtin
- Properly set the fenv state in atomic operations on floating point values
- Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context)
- Fix the many remaining corner cases
llvm-svn: 148242
2012-01-16 17:27:18 +00:00
Richard Smith
dafff94759
constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,
...
APValue::Array and APValue::MemberPointer. All APValue values can now be emitted
as constants.
Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other
entrypoints dealing with constant member pointers are no longer necessary and
will be removed in a later change.
Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to
VarDecl::evaluateValue. This performs caching and deals with the nasty cases in
C++11 where a non-const object's initializer can refer indirectly to
previously-initialized fields within the same object.
Building the intermediate APValue object incurs a measurable performance hit on
pathological testcases with huge initializer lists, so we continue to build IR
directly from the Expr nodes for array and record types outside of C++11.
llvm-svn: 148178
2012-01-14 04:30:29 +00:00
Eli Friedman
d749c6bf2e
Revert r148138; it's causing test failures.
...
llvm-svn: 148141
2012-01-13 21:33:06 +00:00
Sebastian Pop
9a8d528ddf
rename -ccc-host-triple into -target
...
llvm-svn: 148138
2012-01-13 20:37:02 +00:00
Akira Hatanaka
acf9896ca1
Fix test case committed in r147986.
...
llvm-svn: 147993
2012-01-12 01:27:24 +00:00
Akira Hatanaka
32604a9708
Take into account the pointer to an aggregate that is passed as a hidden
...
argument when Offset is initialized.
llvm-svn: 147986
2012-01-12 01:10:09 +00:00
NAKAMURA Takumi
68a75e879d
clang/test/CodeGen/vla-4.c: Relax expression for -Asserts.
...
llvm-svn: 147934
2012-01-11 08:34:52 +00:00
Abramo Bagnara
fa95ed4074
Fixed VLA code generation.
...
llvm-svn: 147933
2012-01-11 08:19:46 +00:00
Akira Hatanaka
428f5b2008
Add field IsIEEE in FloatingLiteral to distinguish between different 128-bit
...
floating point formats.
llvm-svn: 147887
2012-01-10 22:40:09 +00:00
Bill Wendling
86131f2c8d
The `-fwritable-strings' flag doesn't make the backing store strings of all
...
CFStrings writable.
The strings (both Unicode and ASCII) should reside in a read-only section. E.g.,
__TEXT,__cstring instead of __DATA,__data. This is done by making the global
variable created for the strings constant despite the value of that flag.
<rdar://problem/10657500>
llvm-svn: 147845
2012-01-10 08:46:39 +00:00
Akira Hatanaka
1632af603d
Insert padding before unaligned long double arguments.
...
llvm-svn: 147791
2012-01-09 19:31:25 +00:00
Abramo Bagnara
1cd8368eb2
Fixed TypeofExpr AST and code generation.
...
llvm-svn: 147730
2012-01-07 10:52:36 +00:00
Akira Hatanaka
f64e1adcbb
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.
llvm-svn: 147699
2012-01-07 00:25:33 +00:00
Eli Friedman
df88c54f8d
Revert r147655; it's breaking the compiler_rt build on OSX.
...
llvm-svn: 147677
2012-01-06 20:03:09 +00:00
David Chisnall
9217435a33
If we are compiling with -fno-builtin then don't do constant folding of
...
builtins.
This fixes PR11711.
llvm-svn: 147655
2012-01-06 12:20:19 +00:00
Chris Lattner
3ad9042456
fix test on -Asserts builds.
...
llvm-svn: 147558
2012-01-04 22:51:21 +00:00
Chris Lattner
36bc4f41bc
implement rdar://10639962 by keeping track of increased alignment
...
information even in subscripting operations.
llvm-svn: 147557
2012-01-04 22:35:55 +00:00
Craig Topper
b4ceb6fd52
Add FMA4 intrinsics.
...
llvm-svn: 147372
2011-12-30 09:15:03 +00:00
Craig Topper
1de8348db7
Add popcnt feature flag to match gcc. This flag is implied when sse42 is enabled, but can be disabled separately. Move popcnt intrinsics to popcntintrin.h to match gcc.
...
llvm-svn: 147340
2011-12-29 16:10:46 +00:00
Craig Topper
c334dd68a7
Add BMI2 intrinsics.
...
llvm-svn: 147275
2011-12-26 02:31:10 +00:00
Craig Topper
03348d09e3
Change LZCNT and BMI tests to check IR instead of X86 assembly.
...
llvm-svn: 147267
2011-12-25 15:20:31 +00:00
Craig Topper
a06d4a1c40
Add the rest of the BMI intrinsics.
...
llvm-svn: 147265
2011-12-25 07:27:12 +00:00
Craig Topper
f2855ade2b
Add intrinsics for lzcnt and tzcnt instructions.
...
llvm-svn: 147263
2011-12-25 06:25:37 +00:00
Craig Topper
175543ac78
Add last of the AVX2 intrinsics except for gather.
...
llvm-svn: 147253
2011-12-24 17:20:15 +00:00
Craig Topper
a9387739aa
Add AVX2 permute intrinsics. Also add parentheses on some macro arguments in other intrinsic headers.
...
llvm-svn: 147242
2011-12-24 07:55:25 +00:00
Craig Topper
9a01e58447
Add AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.
...
llvm-svn: 147240
2011-12-24 05:19:47 +00:00
Craig Topper
a6fdbd1807
Intrinsics for AVX2 unpack instructions.
...
llvm-svn: 147237
2011-12-24 03:58:43 +00:00
Craig Topper
f4bb952533
More AVX2 intrinsics for shift, psign, some shuffles, and psadbw.
...
llvm-svn: 147236
2011-12-24 03:28:57 +00:00
Craig Topper
235a365d58
Add AVX2 multiply intrinsics.
...
llvm-svn: 147219
2011-12-23 08:31:16 +00:00
Craig Topper
1f2460ad43
Add AVX2 intrinsics for max, min, sign extend, and zero extend.
...
llvm-svn: 147141
2011-12-22 09:18:58 +00:00
Eli Friedman
803acb3ff2
Add support for bitcasts to vector type in Evaluate.
...
llvm-svn: 147137
2011-12-22 03:51:45 +00:00
Eli Friedman
1148b0f13c
Fix a silly mistake in this test that somehow slipped into my last commit.
...
llvm-svn: 147112
2011-12-22 00:06:39 +00:00
Eli Friedman
5c9cd7a8a3
Fix a failure (which led to a crash) in constant emission code with vector compound literals.
...
llvm-svn: 147111
2011-12-22 00:04:00 +00:00
Craig Topper
a73baa8050
Add a few more AVX2 intrinsics and fix the type strings on a couple SSE intrinsics.
...
llvm-svn: 147048
2011-12-21 08:35:05 +00:00
Craig Topper
3fe5ac40db
Add AVX2 horizontal add/sub intrinsics.
...
llvm-svn: 147047
2011-12-21 08:17:40 +00:00
Craig Topper
a89747dd1e
Add AVX2 intrinsics for pavg, pblend, and pcmp instructions. Also remove unneeded builtins for SSE pcmp. Change SSE pcmpeqq and pcmpgtq to not use builtins and just use vector == and >.
...
llvm-svn: 146969
2011-12-20 09:55:26 +00:00
Chris Lattner
4db839a8d4
loads also handled of course.
...
llvm-svn: 146910
2011-12-19 21:17:33 +00:00
Chris Lattner
2415357a05
Fix PR5279 - don't sliently drop alignment information on stores of types that have alignment less than the natural alignment of the type when it comes from a typedef.
...
llvm-svn: 146908
2011-12-19 21:16:08 +00:00
Chris Lattner
494f431097
filecheckize.
...
llvm-svn: 146907
2011-12-19 21:11:59 +00:00
Chris Lattner
7e588a8db0
rename test.
...
llvm-svn: 146906
2011-12-19 21:10:59 +00:00
Eli Friedman
61221b72ee
Attempt to fix test in Release builds.
...
llvm-svn: 146898
2011-12-19 20:09:01 +00:00
Rafael Espindola
ba9cc6c1bb
Add a triple to the test.
...
llvm-svn: 146871
2011-12-19 16:30:30 +00:00
Rafael Espindola
4fdc1759ca
Extend the fix for PR9614 to handle inline asm in the outer decl and
...
the inner decl being a builtin. This is needed to support the glibc headers
in fedora 16 (2.14).
llvm-svn: 146867
2011-12-19 14:41:01 +00:00
Craig Topper
a557e1c122
Add AVX2 intrinsics for and, andn, or, and xor.
...
llvm-svn: 146862
2011-12-19 09:03:48 +00:00
Craig Topper
94aba2c260
More AVX2 intrinsic support including saturating add/sub and palignr.
...
llvm-svn: 146857
2011-12-19 07:03:25 +00:00
Craig Topper
dec792ebb5
Begin adding AVX2 intrinsics. Necessitated increasing the number of bits used to store builtinID when serializing identifier table.
...
llvm-svn: 146855
2011-12-19 05:04:33 +00:00
Chad Rosier
060d03be1c
Fix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
...
intrinsics to use "I" (ICE) markings. Fix avxintrin.h to take them into
account.
Part of rdar://10595450
llvm-svn: 146791
2011-12-17 00:15:26 +00:00
Eli Friedman
516c2ad731
Fix an edge case in IRGen for conditionals. PR11509.
...
llvm-svn: 146189
2011-12-08 22:01:56 +00:00
Richard Smith
161f09abd7
Move vector bitcast handling in constant expressions from the expression
...
evaluator into constant initializer handling / IRGen. The practical consequence
of this is that the bitcast now lives in the constant's definition, rather than
in its uses.
The code in the constant expression evaluator was producing vectors of the wrong
type and size (and possibly of the wrong value for a big-endian int-to-vector
bitcast). We were getting away with this only because we don't yet support
constant-folding of any expressions which inspect vector values.
llvm-svn: 145981
2011-12-06 22:44:34 +00:00
Eli Friedman
6d694a38fd
Make EmitAggregateCopy take an alignment argument. Make EmitFinalDestCopy pass in the correct alignment when known.
...
The test includes a FIXME for a related case involving calls; it's a bit more complicated to fix because the RValue class doesn't keep track of alignment.
<rdar://problem/10463337>
llvm-svn: 145862
2011-12-05 22:23:28 +00:00
Eric Christopher
af6431077c
Add support for AVX registers to clang inline asm. Add a small testcase
...
and update the Sema testcase with a register that we won't hit for a while
I hope.
Fixes rdar://10510405
llvm-svn: 145671
2011-12-02 02:12:16 +00:00
Eric Christopher
5037249cc3
Clean up some oddly gratuitous vertical whitespace.
...
llvm-svn: 145670
2011-12-02 02:12:12 +00:00
Eric Christopher
86e6c07a0c
Rename function.
...
llvm-svn: 145669
2011-12-02 02:12:09 +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
Benjamin Kramer
ddbb2b85ab
CodeGen: allow __asm renaming on static local variables.
...
Fixes PR4777.
llvm-svn: 145015
2011-11-20 21:05:04 +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
Richard Smith
027bf11eb3
Constant expression evaluation: add support for evaluation of member pointers
...
and base-to-derived casts, and add proper handling of temporaries.
llvm-svn: 144926
2011-11-17 22:56:20 +00:00
Eli Friedman
95ff70021c
Fix crash in calling convention code expanding an struct with a complex member.
...
llvm-svn: 144612
2011-11-15 02:46:03 +00:00
Nico Weber
d60b72f696
Fix a regression in wide character codegen. See PR11369.
...
llvm-svn: 144521
2011-11-14 05:17:37 +00:00
Eli Friedman
ce6733a542
Fix test so that it XFAILs consistently.
...
llvm-svn: 143771
2011-11-05 00:49:47 +00:00
Devang Patel
45124500bb
Add new test.
...
llvm-svn: 143706
2011-11-04 17:12:03 +00:00
Devang Patel
f1faeefb32
Add new test.
...
llvm-svn: 143704
2011-11-04 16:57:26 +00:00
Eli Friedman
3d9f47fe6f
Fix alignment on alloca's for parameters using ABIArgInfo::Expand.
...
llvm-svn: 143658
2011-11-03 21:39:02 +00:00
Eli Friedman
eadd3e81a0
Fix the alignment on scalar parameter variables so that it matches what the AST thinks it should be. Per report on cfe-dev.
...
llvm-svn: 143645
2011-11-03 20:31:28 +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
Eli Friedman
86fe42d184
Correct test for additional comment line.
...
llvm-svn: 143436
2011-11-01 04:46:08 +00:00
Eli Friedman
e1f2ce8fd3
Mark test as requiring x86 backend.
...
llvm-svn: 143427
2011-11-01 03:48:36 +00:00
Eli Friedman
97ed64081d
Don't depend on system includes in test.
...
llvm-svn: 143426
2011-11-01 03:35:57 +00:00
Eli Friedman
fc08bdcc57
Tests for UTF-8 encoding in strings in source code. Patch by Seth Cantrell.
...
llvm-svn: 143418
2011-11-01 02:26:36 +00:00
Eli Friedman
fcec630a57
Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
...
treating wide strings as a series of bytes.
Patch by Seth Cantrell.
llvm-svn: 143417
2011-11-01 02:23:42 +00:00
Peter Collingbourne
f1d76db466
Add support for lazily linking bitcode files (using a new
...
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.
llvm-svn: 143314
2011-10-30 17:30:44 +00:00
Rafael Espindola
77a4538c6c
Fix this on the bots and make the test more complete by enabling optimizations.
...
llvm-svn: 143223
2011-10-28 20:52:18 +00:00
Rafael Espindola
fffc1ce1d7
Fix PR9614 for functions with the always_inline attribute. Try to keep
...
the common case (-O0, no always_inline) fast.
llvm-svn: 143222
2011-10-28 20:43:56 +00:00
Nick Lewycky
b25abd1a54
Move these test from checking assembly to checking LLVM IR. Should fix fallout
...
from r143097.
llvm-svn: 143098
2011-10-27 07:11:43 +00:00
Rafael Espindola
be069cb3d0
Fix this tests on the bots.
...
llvm-svn: 143052
2011-10-26 20:46:27 +00:00
Rafael Espindola
c594135b68
Fix pr9614 by not emitting an available_externally function when it calls
...
itself via an asm label.
available_externally functions are supposed to correspond to an external
function, and that is not the case in the examples in pr9614.
llvm-svn: 143049
2011-10-26 20:41:06 +00:00
Dan Gohman
50c756b76f
Remove another Blackfin test.
...
llvm-svn: 142894
2011-10-25 01:02:36 +00:00
Dan Gohman
c44b95c3b5
Remove more SystemZ (s390) tests.
...
llvm-svn: 142883
2011-10-25 00:15:21 +00:00
Eric Christopher
4b4beb2fe7
Fix PR11073 by adding the argument type information to the decl we construct
...
for the function type. Update a testcase accordingly.
Patch initially by Anders Waldenborg!
llvm-svn: 142700
2011-10-21 23:30:10 +00:00
Douglas Gregor
0a92de06f0
Switch tests from grep to FileCheck
...
llvm-svn: 142699
2011-10-21 23:20:41 +00:00
Nick Lewycky
ba743b75cb
Take DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
...
closer to what GCC does, except that GCC also checks that the inodes for $PWD
and '.' match.
llvm-svn: 142633
2011-10-21 02:32:14 +00:00
Eli Friedman
cc66a2b067
Add missing newline.
...
llvm-svn: 142285
2011-10-17 21:48:31 +00:00
Eli Friedman
a4c2602b71
Initial implementation of __atomic_is_lock_free. The input is the size of an atomic type rather than an atomic type itself just to save some implementation pain; I can change that if it seems worthwhile.
...
I think this is the last hook needed for <atomic> besides defines for ATOMIC_CHAR_LOCK_FREE and friends.
llvm-svn: 142281
2011-10-17 21:44:23 +00:00
Tanya Lattner
49b3841398
The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also
...
changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type.
I added a new test case and updated exisiting test cases that assumed an unsigned result.
llvm-svn: 142250
2011-10-17 21:00:38 +00:00
Anton Korobeynikov
f82017f3fe
Missed tests for half FP support
...
llvm-svn: 142017
2011-10-14 23:32:50 +00:00
Eli Friedman
4b72fddd99
Misc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.
...
llvm-svn: 142002
2011-10-14 20:59:01 +00:00
Benjamin Kramer
73eb8c7a8e
Harden test for windows paths.
...
llvm-svn: 141973
2011-10-14 19:03:46 +00:00
Richard Smith
9ca5c42582
Update all tests other than Driver/std.cpp to use -std=c++11 rather than
...
-std=c++0x. Patch by Ahmed Charles!
llvm-svn: 141900
2011-10-13 22:29:44 +00:00