summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of storelv4si builtin as it can be expressed directly. This is generalChad Rosier2012-05-012-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | goodness because it provides opportunites to cleanup things. For example, uint64_t t1(__m128i vA) { uint64_t Alo; _mm_storel_epi64((__m128i*)&Alo, vA); return Alo; } was generating movq %xmm0, -8(%rbp) movq -8(%rbp), %rax and now generates movd %xmm0, %rax rdar://11282581 llvm-svn: 155924
* Currently __builtin_annotation() only annotates an i32.Julien Lerouge2012-04-281-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | i32 __builtin_annotation(i32, string); Applying it to i64 (e.g., long long) generates the following IR. trunc i64 {{.*}} to i32 call i32 @llvm.annotation.i32 zext i32 {{.*}} to i64 The redundant truncation and extension make the result difficult to use. This patch makes __builtin_annotation() generic. type __builtin_annotation(type, string); For the i64 example, it simplifies the generated IR to: call i64 @llvm.annotation.i64 Patch by Xi Wang! llvm-svn: 155764
* Fix a bug with block layout when the block contains somethingJohn McCall2012-04-261-0/+8
| | | | | | | | | | | | more aligned than the block header but also contains something smaller than the block-header alignment but not exactly half the difference between the large alignment and the header alignment. Got that? I'm really not sure what I was thinking with the buggy computation here, but the fix is pretty obvious. llvm-svn: 155662
* Add atan, atan2, exp, and log to the builtin math library functions.Chad Rosier2012-04-241-0/+45
| | | | | | | | | With -fno-math-errno (the default for Darwin) or -ffast-math these library function can be marked readnone enabling more opportunities for CSE and other optimizations. rdar://11251464 llvm-svn: 155498
* enable TBAA when -fthread-sanitizer is given, even with -O0 or ↵Kostya Serebryany2012-04-241-2/+10
| | | | | | -relaxed-aliasing llvm-svn: 155430
* Forward declarations should take a context. This helps the debuggerEric Christopher2012-04-233-5/+5
| | | | | | | | | find forward declarations in the context that the actual definition will occur. rdar://11291658 llvm-svn: 155381
* Do not use stdint.h, driver might provide invalid location for it. Instead, ↵Anton Korobeynikov2012-04-231-1/+3
| | | | | | | | provide the types directly. This should fix PR12628 llvm-svn: 155342
* Convert vperm2f128 and vperm2i128 intrinsics back to using llvm intrinsics. ↵Craig Topper2012-04-173-4/+7
| | | | | | Unfortunately, these instructions have behavior that can't be modeled with shuffle vector. llvm-svn: 154906
* Attempt to fix test.Eli Friedman2012-04-171-1/+1
| | | | llvm-svn: 154897
* Make sure EmitMoveFromReturnSlot is passing the correct alignment toChad Rosier2012-04-171-0/+8
| | | | | | | EmitFinalDestCopy (and thus pass EmitAggregateCopy the correct alignment). rdar://11220251 llvm-svn: 154883
* Remove support for -fast-math metadata for the moment.Duncan Sands2012-04-161-8/+0
| | | | llvm-svn: 154851
* Generate fpmath metadata when -ffast-math. Note that no optimizations are hookedDuncan Sands2012-04-161-0/+8
| | | | | | up to this yet. llvm-svn: 154835
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-161-1/+9
| | | | llvm-svn: 154789
* Change _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use ↵Craig Topper2012-04-151-2/+2
| | | | | | builtin_shufflevector instead of specific builtins. Old builtins will be removed from llvm now that vpermq/vpermpd are supported by shuffle lowering code. llvm-svn: 154777
* Use MDBuilder to help with metadata creation.Duncan Sands2012-04-152-2/+2
| | | | llvm-svn: 154767
* First set of tests for ARM homogenous aggregates. C only. C++ will follow.Anton Korobeynikov2012-04-131-0/+158
| | | | llvm-svn: 154666
* Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set ofRichard Smith2012-04-131-0/+15
| | | | | | GNU __atomic builtins. llvm-svn: 154659
* Implement the missing pieces needed to support libstdc++4.7's <atomic>:Richard Smith2012-04-131-5/+51
| | | | | | | | | | | | | | | | | | | | | | | | __atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_* predefined macros. Implement library fallback for __atomic_is_lock_free and __c11_atomic_is_lock_free, and implement __atomic_always_lock_free. Contrary to their documentation, GCC's __atomic_fetch_add family don't multiply the operand by sizeof(T) when operating on a pointer type. libstdc++ relies on this quirk. Remove this handling for all but the __c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins. Contrary to their documentation, __atomic_test_and_set and __atomic_clear take a first argument of type 'volatile void *', not 'void *' or 'bool *', and __atomic_is_lock_free and __atomic_always_lock_free have an argument of type 'const volatile void *', not 'void *'. With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite, except for a couple of libstdc++ bugs and some cases where libc++'s test suite tests for properties which implementations have latitude to vary. llvm-svn: 154640
* Implement support for 18 of the GNU-compatible __atomic builtins.Richard Smith2012-04-122-23/+134
| | | | | | | | | | | | This is not quite sufficient for libstdc++'s <atomic>: we still need __atomic_test_and_set and __atomic_clear, and may need a more complete __atomic_is_lock_free implementation. We are also missing an implementation of __atomic_always_lock_free, __atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed for libstdc++. llvm-svn: 154579
* Provide, and document, a set of __c11_atomic_* intrinsics to implement C11'sRichard Smith2012-04-112-20/+20
| | | | | | | | | <stdatomic.h> header. In passing, fix LanguageExtensions to note that C11 and C++11 are no longer "upcoming standards" but are now actually standardized. llvm-svn: 154513
* AtomicExpr: make ASTStmtReader a friend and remove setters. Also fix savingRichard Smith2012-04-101-0/+9
| | | | | | | of an uninitialized Stmt* in serialization of __atomic_init and add a test of atomics serialization. llvm-svn: 154448
* This test actually needs label names.Eric Christopher2012-04-101-1/+2
| | | | | | PR9796 llvm-svn: 154422
* For debug and coverage analysis if we're not optimizing go aheadEric Christopher2012-04-102-22/+28
| | | | | | | | | and emit a relatively empty block for a plain break statement. This enables us to track where we went through a switch. PR9796 & rdar://11215207 llvm-svn: 154420
* Make the variant of __builtin_shufflevector that takes the shuffle indexes ↵Eli Friedman2012-04-051-0/+35
| | | | | | as a vector actually usable. Patch by David Neto. PR12465. llvm-svn: 154128
* Add more constraint registers for mips.Eric Christopher2012-04-031-0/+44
| | | | | | Patch by Jack Carter. Testcase cleanup by me. llvm-svn: 153921
* Correctly check argument types for some vector macros in smmintrin.h. Put ↵Craig Topper2012-03-301-0/+44
| | | | | | parentheses around uses of vector macro arguments. llvm-svn: 153732
* Add _mm_minpos_epu16 to smmintrin.h. Fixes PR12399.Craig Topper2012-03-301-0/+5
| | | | llvm-svn: 153726
* Fix shuffle vector calculation for mm_permute_ps. Fixes PR 12401.Craig Topper2012-03-301-0/+7
| | | | llvm-svn: 153724
* The UTF16 string referenced by a CFString should go into the __TEXT,__ustringBill Wendling2012-03-302-2/+15
| | | | | | | | | | | | | section. A 'normal' string will go into the __TEXT,__const section, but this isn't good for UTF16 strings. The __ustring section allows for coalescing, among other niceties (such as allowing the linker to easily split up strings). Instead of outputting the UTF16 string as a series of bytes, output it as a series of shorts. The back-end will then nicely place the UTF16 string into the correct section, because it's a mensch. <rdar://problem/10655949> llvm-svn: 153710
* Relax the test slightly so that it should pass on other people's computers.David Chisnall2012-03-291-4/+4
| | | | llvm-svn: 153670
* Call out to GCC-compatible runtime functions for atomic ops that we can't useDavid Chisnall2012-03-291-0/+36
| | | | | | | | | | | | | | LLVM intrinsics for. I have an implementation of these functions, which wants to go in a libgcc_s equivalent in compiler-rt. It's currently here: http://people.freebsd.org/~theraven/atomic.c It will be committed to compiler-rt as soon as I work out where would be a sensible place to put it... llvm-svn: 153666
* Add better support for $fp and $sp for mips inline asm support.Eric Christopher2012-03-271-0/+80
| | | | | | Patch by Jack Carter. llvm-svn: 153530
* [tests] Fix test failure in release mode.Daniel Dunbar2012-03-261-1/+1
| | | | llvm-svn: 153460
* add tbaa metadata to vtable pointer loads/storesKostya Serebryany2012-03-261-0/+19
| | | | llvm-svn: 153447
* Add back r153360 with a fix for enums that cover all the 32 bit values.Rafael Espindola2012-03-241-0/+11
| | | | | | Thanks to NAKAMURA Takumi for finding it! llvm-svn: 153383
* Revert r153360 (and r153380), "Second part of PR12251. Produce the range ↵NAKAMURA Takumi2012-03-241-11/+0
| | | | | | | | | | metadata in clang for booleans and". For i686 targets (eg. cygwin), I saw "Range must not be empty!" in verifier. It produces (i32)[0x80000000:0x80000000) from (uint64_t)[0xFFFFFFFF80000000ULL:0x0000000080000000ULL), for signed i32 on MDNode::Range. llvm-svn: 153382
* Second part of PR12251. Produce the range metadata in clang for booleans andRafael Espindola2012-03-241-0/+11
| | | | | | c++ enums. llvm-svn: 153360
* Small cleanup.Bill Wendling2012-03-221-8/+8
| | | | llvm-svn: 153292
* Use correct FileCheck regexp.Bill Wendling2012-03-221-1/+1
| | | | llvm-svn: 153291
* When an MMX output variable is tied to the input variable, we have to implicitlyBill Wendling2012-03-221-0/+9
| | | | | | | cast the value to x86_mmx. This gives the ASM string the correct call signature. <rdar://problem/10919182> llvm-svn: 153290
* line endingsMatt Beaumont-Gay2012-03-221-27/+27
| | | | llvm-svn: 153289
* Make sure we correctly set the alignment for vector loads and stores ↵Eli Friedman2012-03-221-0/+27
| | | | | | associated with vector element lvalues. Patch by Kevin Schoedel (with some minor modifications by me). llvm-svn: 153285
* Don't try to create "store atomic" instructions of non-integer types; they ↵Eli Friedman2012-03-161-2/+6
| | | | | | aren't supported at the moment. PR12040. llvm-svn: 152891
* When a variable has a specified asm name, but isn't using the register ↵Eli Friedman2012-03-151-0/+6
| | | | | | storage class, the asm name doesn't specify a register. PR12244. llvm-svn: 152873
* [frontend] Fix how the frontend handles -fno-inline. AFAIK clang now matchesChad Rosier2012-03-151-1/+1
| | | | | | | the behavior of gcc with respect to the -fno-inline and -fno-inline-functions flags. llvm-svn: 152861
* Fix codegen for vld{3,4}_dup intrinsics.James Molloy2012-03-151-0/+49
| | | | | | Patch by Silviu Baranga! llvm-svn: 152788
* [frontend] Add support for disabling the "inline" keyword using Chad Rosier2012-03-141-1/+2
| | | | | | | | | | | -fno-inline-functions. This behaves much like -fno-inline in gcc, but based on a discussion with Daniel it was decided that -fno-inline-functions should subsume -fno-inline. Please speak up if you object. The -fno-inline flag remains ignored. Final part of rdar://10972766 llvm-svn: 152754
* Fix the long double to be of width/align 64. Rename va_list_test toRoman Divacky2012-03-131-0/+4
| | | | | | powerpc_types and add testing for the (long) double there. llvm-svn: 152647
* Use ZeroLengthBitfieldAlignment for AAPCS, as well as APCS-GNU.James Molloy2012-03-121-0/+236
| | | | llvm-svn: 152552
* IRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.Daniel Dunbar2012-03-102-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - We do this when it is easy to determine that the backend will pass them on the stack properly by itself. Currently LLVM codegen is really bad in some cases with byval, for example, on the test case here (which is derived from Sema code, which likes to pass SourceLocations around):: struct s47 { unsigned a; }; void f47(int,int,int,int,int,int,struct s47); void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); } we used to emit code like this:: ... movl %esi, -8(%rbp) movl -8(%rbp), %ecx movl %ecx, (%rsp) ... to handle moving the struct onto the stack, which is just appalling. Now we generate:: movl %esi, (%rsp) which seems better, no? llvm-svn: 152462
OpenPOWER on IntegriCloud