Commit Graph

237 Commits

Author SHA1 Message Date
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
Bill Wendling 6869b6abf8 Simplification noticed by Chris.
llvm-svn: 130864
2011-05-04 20:28:12 +00:00
Bill Wendling 5f9150b5b1 Convert the non-temporal store builtins to LLVM-native IR.
llvm-svn: 130830
2011-05-04 02:40:38 +00:00
Fariborz Jahanian 24ac1599fc Generalize case for built-in expressions having
side-effect to generate their ir. Not just for
__builtin_expect. // rdar://9330105

llvm-svn: 130172
2011-04-25 23:10:07 +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
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
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
Michael J. Spencer 6826eb816a Add 3DNow! Intrinsics.
llvm-svn: 129570
2011-04-15 15:07:13 +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
Bill Wendling 88ae43772a It looks like the FreeBSD buildbot needs this for the builtins-x86.c test.
llvm-svn: 129433
2011-04-13 10:02:54 +00:00
Bill Wendling b9c9e34cb3 Just use a native "load" instead of translating the builtin later. Clang can
take it!

I wasn't able to get __builtin_ia32_loaddqu to transform into an unaligned
load...I'll have to look into it further.

llvm-svn: 129427
2011-04-13 05:58:17 +00:00
Bill Wendling 3137d3cb49 Convert the unaligned load builtins to the first-class versions.
llvm-svn: 129420
2011-04-13 00:36:37 +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
Matt Beaumont-Gay 873c6dd875 Oops, prefer C-style cast here
llvm-svn: 128607
2011-03-31 01:56:27 +00:00
Matt Beaumont-Gay a25fce8e9e Silence GCC warning about differing types on the branches of a conditional expression
llvm-svn: 128605
2011-03-31 01:43:22 +00:00
Bob Wilson 7201af3914 Use intrinsics for Neon vmull operations. Radar 9208957.
llvm-svn: 128590
2011-03-31 00:09:00 +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
Jay Foad 27e20c3c58 (Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128534
2011-03-30 11:19:06 +00:00
Eli Friedman b4d3c99929 Make sure we aggressively attach nounwind (etc.) to calls to library
functions of the form __builtin_XXX.

llvm-svn: 128198
2011-03-24 05:09:45 +00:00
Eric Christopher cf5e83b471 __clear_cache() is varargs and people will occasionally write it without
arguments. Process only the arguments that people write, but process
all of them.

Fixes rdar://8900346

llvm-svn: 127616
2011-03-14 20:30:34 +00:00
Chris Lattner 91c08ad14a update for ConstantVector API change.
llvm-svn: 125538
2011-02-15 00:14:06 +00:00
Chris Lattner dd68bd0a65 revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.

llvm-svn: 125505
2011-02-14 18:16:09 +00:00
Chris Lattner 2d9a7672db update for ConstantVector::get API change.
llvm-svn: 125488
2011-02-14 07:55:40 +00:00
John McCall ad7c5c1657 Reorganize CodeGen{Function,Module} to eliminate the unfortunate
Block{Function,Module} base class.  Minor other refactorings.

Fixed a few address-space bugs while I was there.

llvm-svn: 125085
2011-02-08 08:22:06 +00:00
Ted Kremenek 582a0999fb Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

llvm-svn: 124072
2011-01-23 17:04:59 +00:00
John McCall 20f6ab828a Fix a latent bug where, after emitting an expression statement, we would
delete the block we began emitting into if it had no predecessors.  We never
want to do this, because there are several valid cases during statement
emission where an existing block has no known predecessors but will acquire
some later.  The case in my test case doesn't inherently fall into this 
category, because we could safely emit the case-range code before the statement
body, but there are examples with labels that can't be fallen into 
that would also demonstrate this bug.

rdar://problem/8837067

llvm-svn: 123303
2011-01-12 03:41:02 +00:00
Benjamin Kramer 39f987ffd0 Make a helper function static.
llvm-svn: 123118
2011-01-09 13:21:33 +00:00
Benjamin Kramer acc6b4e2fd Simplify mem{cpy, move, set} creation with IRBuilder.
llvm-svn: 122634
2010-12-30 00:13:21 +00:00
Bob Wilson 63fbbc6ef8 Implement builtins for Neon half-precision float conversions.
Also tweak the VCVT_F32_F16 entry in arm_neon.td to be more consistent with
the other floating-point conversion builtins.  Radar 8068427.

llvm-svn: 121916
2010-12-15 23:36:44 +00:00
Bob Wilson 546b691c73 Add missing switch case for the quad-register version of the Neon vmul builtin.
llvm-svn: 121595
2010-12-10 23:09:09 +00:00
Bob Wilson 0348af667a Fix clang crashes on Neon vld[234]_dup intrinsics with 64-bit element types.
The 64-bit element vectors need to be handled as a special case.

llvm-svn: 121592
2010-12-10 22:54:58 +00:00
Bob Wilson 4c4a00a10b Add missing switch case to handle builtin for Neon vqnegq.
llvm-svn: 121468
2010-12-10 06:26:19 +00:00
Bob Wilson d1767c5c15 LLVM's intrinsics for vpaddl and vpadal have 2 overloaded types.
Clang was only specifying the overloaded result type.  PR8483.

llvm-svn: 121464
2010-12-10 05:51:07 +00:00
Bob Wilson 571c907cdf Neon compare absolute LLVM intrinsics are not overloaded. PR8484.
llvm-svn: 121447
2010-12-10 01:11:38 +00:00
Bob Wilson 482afae812 Stop using builtins for the "_lane" variants of saturating multiply intrinsics.
Remove the "splat" parameter from the EmitNeonCall function, since it is no
longer needed.

llvm-svn: 121300
2010-12-08 22:37:56 +00:00
Bob Wilson b038120094 Stop using clang builtins for Neon vabdl and vabal intrinsics.
llvm-svn: 121288
2010-12-08 21:39:47 +00:00
Bob Wilson 7d66df9c33 Stop using clang builtins for Neon vaba intrinsics.
llvm-svn: 121277
2010-12-08 20:09:54 +00:00
Chandler Carruth 8005adf031 Silence an unused variable warning.
llvm-svn: 121221
2010-12-08 01:29:17 +00:00
Bob Wilson 8811c3a72e Stop using clang builtins for Neon vadd[lw] and vsub[lw] intrinsics.
llvm-svn: 121214
2010-12-08 00:14:43 +00:00
Bob Wilson f81b09db68 Stop using clang builtins for Neon vmlal{_n,_lane} and vmlsl{_n,_lane}.
llvm-svn: 121210
2010-12-07 23:54:55 +00:00
Bob Wilson 210f6ddecc Stop using a clang builtin for Neon vdup_lane intrinsics.
llvm-svn: 121191
2010-12-07 22:40:02 +00:00
Bob Wilson 7f3c0aa96f Stop using a clang builtin for Neon vmull_lane intrinsic.
llvm-svn: 121189
2010-12-07 22:03:46 +00:00
Bob Wilson 160fdf49e4 Add a missing parameter, without which clang crashes for vqshlu_n intrinsics.
llvm-svn: 121188
2010-12-07 22:03:43 +00:00
Bob Wilson 7795599f4b Add support for vmul_p8 Neon intrinsic. Radar 8446141.
llvm-svn: 120812
2010-12-03 17:29:39 +00:00
Bob Wilson 4fa993fc51 Add a separate rightShift flag instead of reusing the existing "poly" variable
to distinguish vsri/vsli.

llvm-svn: 120806
2010-12-03 17:10:22 +00:00
John McCall 3a7f6926d1 Restore r117403 (fixing IR gen for bool atomics), this time being less
aggressive about the form we expect bools to be in.  I don't really have
time to fix all the sources right now.

llvm-svn: 117486
2010-10-27 20:58:56 +00:00
Rafael Espindola 9d798a07e4 Revert r117403 as it caused PR8480.
llvm-svn: 117456
2010-10-27 17:13:49 +00:00
John McCall 6bde954f47 Extract procedures to do scalar-to-memory and memory-to-scalar conversions
in IR gen, and use those to fix a correctness issue with bool atomic
intrinsics.  rdar://problem/8461234

llvm-svn: 117403
2010-10-26 22:09:15 +00:00
Argyrios Kyrtzidis 073c9cb592 Implement __builtin_ia32_vec_ext_v2si function (required by Qt).
llvm-svn: 116162
2010-10-10 03:19:11 +00:00