Eli Friedman
2f1e9e618c
Make __builtin_shufflevector and -ftrapv work correctly together. PR9945.
...
llvm-svn: 131611
2011-05-19 00:37:32 +00:00
Joerg Sonnenberger
caf8ffd8e3
Bug 8765: Honor assembler labels for builtins. Ensure that the label is
...
mangled to avoid doing it twice for platforms that use prefixes like
Darwin.
llvm-svn: 131311
2011-05-13 21:12:10 +00:00
Bill Wendling
bb455154a1
Remove the 'unaligned load' builtins now that they're no longer used in the *mmintrin.h files.
...
llvm-svn: 131300
2011-05-13 18:52:28 +00:00
Bill Wendling
e106c34817
LLVM doesn't always optimize away the four loads from this:
...
(__m128){ p[0], p[1], p[2], p[3] }
which produces really bad code. This could be done in instcombine, but it's
probably better to do it in the front-end instead.
<rdar://problem/9424836>
llvm-svn: 131237
2011-05-12 19:02:15 +00:00
Fariborz Jahanian
b0c0cdc509
Clean up consequences of cut and paste.
...
llvm-svn: 131190
2011-05-11 17:07:02 +00:00
Fariborz Jahanian
783243b3ca
Implenment #pack pragma and ms_struct attribute layout.
...
Concludes // radar://8823265.
llvm-svn: 131188
2011-05-11 16:58:31 +00:00
Fariborz Jahanian
07ceb0a1a4
Support pack pragma and ms_struct attributes. // rdar://8823265
...
llvm-svn: 131142
2011-05-10 19:00:50 +00:00
Fariborz Jahanian
7adbed6b4d
'long long' requires special treatment in ms_struct
...
structs (impacts 32-bit only though).
llvm-svn: 131103
2011-05-09 22:03:17 +00:00
Douglas Gregor
9ca5465500
Revert r130717, which caused a regression (<rdar://problem/9402621>).
...
llvm-svn: 131057
2011-05-07 20:12:26 +00:00
Fariborz Jahanian
307eace474
In ms_struct structs, Establish a new alignment for a
...
non-bitfield following a bitfield if size of their types differ.
llvm-svn: 131032
2011-05-06 22:42:22 +00:00
Fariborz Jahanian
b7a2879677
Establish a new alignment for an ms_struct bitfield following
...
a non-bitfield if size of their types differ.
llvm-svn: 131023
2011-05-06 21:56:12 +00:00
Eli Friedman
409943efcb
Don't emit nsw flags for vector operations; there's basically no benefit, and a lot of downside (like PR9850, which is about clang's xmmintrin.h making an unexpected transformation on an expression involving _mm_add_epi32).
...
llvm-svn: 131000
2011-05-06 18:04:18 +00:00
Fariborz Jahanian
9f1071831f
__alignof attribute on the field must consider
...
packed attribute on the field. //rdar://9217290
llvm-svn: 130948
2011-05-05 21:19:14 +00:00
Daniel Dunbar
6cb7f64e8b
tests: Force a triple in this test (so uint128 is present).
...
llvm-svn: 130941
2011-05-05 18:54:06 +00:00
Devang Patel
979aba5d09
Do not drop uint128 on the floor.
...
llvm-svn: 130929
2011-05-05 17:06:30 +00:00
Fariborz Jahanian
9d82fea378
And a test case for my last patch.
...
llvm-svn: 130853
2011-05-04 18:58:27 +00:00
Fariborz Jahanian
84335f7c8e
More ms_struct bitfield stuff:
...
Adjacent bit fields are packed into the same 1-, 2-, or
4-byte allocation unit if the integral types are the same
size. // rdar://8823265.
llvm-svn: 130851
2011-05-04 18:51:37 +00:00
Fariborz Jahanian
759e4a1add
Only the first zero-length bitfield decides alignment of
...
the followup data member in an ms_struct struct.
// rdar:// 8823265
llvm-svn: 130795
2011-05-03 22:07:14 +00:00
Fariborz Jahanian
fc0fe6eb52
Finish off rules for z-length bitfields in ms_struct
...
structs. // rdar://8823265
llvm-svn: 130783
2011-05-03 20:21:04 +00:00
Chad Rosier
f897d3b88b
Fixed test case asserts due to checkin of r130710.
...
llvm-svn: 130720
2011-05-02 20:39:21 +00:00
Eli Friedman
30458b51e3
Skip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0.
...
llvm-svn: 130717
2011-05-02 20:24:29 +00:00
Fariborz Jahanian
eb39741c0b
More rule enforcement of zero bitfields for ms_struct.
...
llvm-svn: 130696
2011-05-02 17:20:56 +00:00
Fariborz Jahanian
99514b9168
block variables on lhs need be ir-gen'ed after the
...
rhs when its 'forwarding' pointer may be modified
in rhs evaluation as result of call to Block_copy.
// rdar://9309454
llvm-svn: 130545
2011-04-29 21:53:21 +00:00
Fariborz Jahanian
8409bce4ac
ms_struct patch for initialization and field access irgen.
...
// rdar://8823265 - wip.
llvm-svn: 130451
2011-04-28 22:49:46 +00:00
Fariborz Jahanian
bcb23a180b
With ms_struct attribut, Zero-length bitfields following
...
non-bitfield members are ignore. // rdar://8823265 wip
llvm-svn: 130257
2011-04-26 23:52:16 +00:00
Fariborz Jahanian
5a866c0bf2
Ir-gen the side-effect(s) when __builtin_expect is
...
constant-folded. // rdar://9330105
llvm-svn: 130163
2011-04-25 22:30:02 +00:00
Bob Wilson
ee674fb73d
Workaround buildbot failure by hacking up this test to emit llvm IR.
...
This is not a real fix. It needs some checks to make sure the IR is correct.
llvm-svn: 130012
2011-04-22 20:42:46 +00:00
Justin Holewinski
bd4a3c03ff
PTX: Add default PTX calling conventions
...
llvm-svn: 129987
2011-04-22 11:10:38 +00:00
Bob Wilson
bf0cd6b83d
Add a testcase for svn r129964 (Neon load/store intrinsic alignments).
...
llvm-svn: 129979
2011-04-22 04:06:49 +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
Chris Lattner
54fd1a1ad3
fix a crash on code that uses the result value of __builtin___memcpy_chk.
...
llvm-svn: 129892
2011-04-20 23:14:50 +00:00
Justin Holewinski
514cce8e43
PTX: Add PTX intrinsics as builtins and add ptx32 and ptx64 as valid architectures for triples, e.g. ptx32-unknown-unknown
...
llvm-svn: 129870
2011-04-20 19:34:15 +00:00
Chris Lattner
97bbee2fb4
Fix a miscompilation I introduced in r129652, thanks for Eli for tracking
...
it down. we effectively were compile the testcase into:
void test14(int x) {
switch (x) {
case 11: break;
case 42: test14(97); // fallthrough
default: test14(42); break;
which is not the same thing at all. This fixes a miscompilation of
MallocBench/gs seen on the clang-x86_64-linux-fnt buildbot.
llvm-svn: 129679
2011-04-17 23:21:26 +00:00
Chris Lattner
38b6057a93
when assertions are disabled, labels go away. Hopefully fixes the windows build.
...
llvm-svn: 129660
2011-04-17 16:19:57 +00:00
Chris Lattner
bc204c8043
implement rdar://9289524 - case followed immediately by break results in empty IR block,
...
a -O0 code quality issue.
llvm-svn: 129652
2011-04-17 00:54:30 +00:00
Chris Lattner
30107ed600
fold memcpy/set/move_chk to llvm.memcpy/set/move when the sizes
...
are trivial. This exposes opportunities earlier, and allows fastisel
to do good things with these at -O0.
This addresses rdar://9289468 - clang doesn't fold memset_chk at -O0
llvm-svn: 129651
2011-04-17 00:40:24 +00:00
Chris Lattner
56784f9de6
fix rdar://9289603 - clang should fold trivial ?: for enums as well as integer constants into select at -O0
...
by making the isCheapEnoughToEvaluateUnconditionally predicate handle anything that folds to a constant. In particular, we now fold enums.
llvm-svn: 129649
2011-04-16 23:15:35 +00:00
Michael J. Spencer
6826eb816a
Add 3DNow! Intrinsics.
...
llvm-svn: 129570
2011-04-15 15:07:13 +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
Bill Wendling
a865185ad6
Removing the unaligned load tests from builtins-x86.c since they're generated by a regular 'load' now.
...
llvm-svn: 129464
2011-04-13 20:17:22 +00:00
Eli Friedman
493c34a86c
PR9580: Handle vectors correctly in ScalarExprEmitter::EmitRem.
...
While I'm here, FileCheck-ize the ext-vector test, so we actually check
what it is generating.
llvm-svn: 129241
2011-04-10 04:44:11 +00:00
Eli Friedman
c5b20b5283
PR8369: make __attribute((regparm(0))) work correctly. Original patch by
...
pageexec@freemail.hu , tweaks by me.
llvm-svn: 129206
2011-04-09 08:18:08 +00:00
Chris Lattner
9cb59fa834
add a __sync_swap builtin to fill out the rest of the __sync builtins.
...
Patch by Dave Zarzycki!
llvm-svn: 129189
2011-04-09 03:57:26 +00:00
John McCall
26d365e149
I can't figure out any reasonable way to make this test non-host-dependent,
...
so I'm killing it.
llvm-svn: 129026
2011-04-06 20:46:42 +00:00
Peter Collingbourne
ba3e6667cc
Do not use IR marker for LLVM intrinsics
...
llvm-svn: 129001
2011-04-06 12:29:09 +00:00
John McCall
b1915d62a7
Make this a -cc1 test with a triple and a target feature.
...
llvm-svn: 128993
2011-04-06 06:48:04 +00:00
John McCall
3cacdf5dbb
Anonymify this test.
...
llvm-svn: 128987
2011-04-06 04:29:52 +00:00
John McCall
91a528841b
Implement the AVX cmp builtins as macros instead of static inlines.
...
Patch by Syoyo Fujita! Reviewed by Chris Lattner! Checked in by me!
llvm-svn: 128984
2011-04-06 03:37:51 +00:00
Daniel Dunbar
826342774e
IRgen: Reapply r128691 with a fix to ensure we don't increase alignment past
...
that of the array element type.
llvm-svn: 128698
2011-04-01 00:49:43 +00:00