summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-4/+4
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* [ubsan] Add flag to enable recovery from checks when possible.Will Dietz2012-12-021-1/+1
| | | | llvm-svn: 169114
* Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith2012-11-051-1/+1
| | | | | | | checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
* Cleanup some clang code to use new type functions instead of using cast<>.Micah Villmow2012-10-251-12/+6
| | | | llvm-svn: 166684
* "Implement" codegen support for __noop().Nico Weber2012-10-131-0/+2
| | | | | | | Eli discovered that __noop's sema behavior also needs some love. I filed PR14081 for that and intend to improve it. llvm-svn: 165886
* -fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith2012-10-091-1/+3
| | | | | | of the checks fails. llvm-svn: 165536
* Move TargetData to DataLayout.Micah Villmow2012-10-081-1/+1
| | | | llvm-svn: 165395
* Expose __builtin_bswap16.Benjamin Kramer2012-10-061-0/+1
| | | | | | | GCC has always supported this on PowerPC and 4.8 supports it on all platforms, so it's a good idea to expose it in clang too. LLVM supports this on all targets. llvm-svn: 165362
* Add an FMA intrinsic for ARM Neon.Bob Wilson2012-09-291-0/+8
| | | | llvm-svn: 164904
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-271-3/+3
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766 llvm-svn: 164769
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-271-3/+3
| | | | llvm-svn: 164766
* Add codegen support for the __debugbreak intrinsic.Nico Weber2012-09-261-0/+4
| | | | llvm-svn: 164660
* ARM: Use a dedicated intrinsic for vector bitwise select.Jim Grosbach2012-09-211-0/+4
| | | | | | | | | | | The expression based expansion too often results in IR level optimizations splitting the intermediate values into separate basic blocks, preventing the formation of the VBSL instruction as the code author intended. In particular, LICM would often hoist part of the computation out of a loop. rdar://11011471 llvm-svn: 164342
* Tidy up. Trailing whitespace and 80 columns.Jim Grosbach2012-09-211-67/+69
| | | | llvm-svn: 164341
* -fcatch-undefined-behavior: Factor emission of the creation of, and branch to,Richard Smith2012-09-081-1/+1
| | | | | | | | | the trap BB out of the individual checks and into a common function, to prepare for making this code call into a runtime library. Rename the existing EmitCheck to EmitTypeCheck to clarify it and to move it out of the way of the new EmitCheck. llvm-svn: 163451
* Make alignment computation for pointer values for builtins handleEli Friedman2012-08-291-1/+2
| | | | | | non-pointer types with a pointer representation correctly. PR13660. llvm-svn: 162862
* Attempt to fix clang bootstrap (broken by r162425).Eli Friedman2012-08-231-2/+22
| | | | llvm-svn: 162440
* Use the alignment from lvalue emission to more accurately compute the alignmentEli Friedman2012-08-231-86/+144
| | | | | | | of a pointer for builtin emission, instead of just depending on the type of the pointee. <rdar://problem/11314941>. llvm-svn: 162425
* irgen: inline code for several of complex builtinFariborz Jahanian2012-08-141-0/+29
| | | | | | calls. // rdar://8315199 llvm-svn: 161891
* Avoid using i64 types for vld1q_lane/vst1q_lane intrinsics.Bob Wilson2012-08-141-4/+36
| | | | | | | | | The backend has to legalize i64 types by splitting them into two 32-bit pieces, which leads to poor quality code. If we produce code for these intrinsics that uses one-element vector types, which can live in Neon vector registers without getting split up, then the generated code is much better. Radar 11998303. llvm-svn: 161879
* Add __builtin_readcyclecounter() to produce the @llvm.readcyclecounter() ↵Hal Finkel2012-08-051-0/+4
| | | | | | intrinsic. llvm-svn: 161310
* More replacing of target-dependent intrinsics with target-indepdent Joel Jones2012-07-181-2/+3
| | | | | | | | | | | | | | | | | | | | | intrinsics. The second instruction(s) to be handled are the vector versions of count set bits (ctpop). The changes here are to clang so that it generates a target independent vector ctpop when it sees an ARM dependent vector bits set count. The changes in llvm are to match the target independent vector ctpop and in VMCore/AutoUpgrade.cpp to update any existing bc files containing ARM dependent vector pop counts with target-independent ctpops. There are also changes to an existing test case in llvm for ARM vector count instructions and to a test for the bitcode upgrade. <rdar://problem/11892519> There is deliberately no test for the change to clang, as so far as I know, no consensus has been reached regarding how to test neon instructions in clang; q.v. <rdar://problem/8762292> llvm-svn: 160409
* Revert commit r160308. We decide to move builtins selection to the backend.Simon Atanasyan2012-07-171-29/+0
| | | | llvm-svn: 160353
* MIPS: Implement __builtin_mips_shll_qb builtin function overloading.Simon Atanasyan2012-07-161-0/+29
| | | | | | | This function has two versions. The first one is used for a register operand. The second one is used for an immediate number. llvm-svn: 160308
* Capitalize comment.Eric Christopher2012-07-141-1/+1
| | | | llvm-svn: 160220
* This is one of the first steps at moving to replace target-dependent Joel Jones2012-07-131-1/+4
| | | | | | | | | | | | | | | | | | | | intrinsics with target-indepdent intrinsics. The first instruction(s) to be handled are the vector versions of count leading zeros (ctlz). The changes here are to clang so that it generates a target independent vector ctlz when it sees an ARM dependent vector ctlz. The changes in llvm are to match the target independent vector ctlz and in VMCore/AutoUpgrade.cpp to update any existing bc files containing ARM dependent vector ctlzs with target-independent ctlzs. There are also changes to an existing test case in llvm for ARM vector count instructions and a new test for the bitcode upgrade. <rdar://problem/11831778> There is deliberately no test for the change to clang, as so far as I know, no consensus has been reached regarding how to test neon instructions in clang; q.v. <rdar://problem/8762292> llvm-svn: 160201
* Add _rdrand{16,32,64}_step intrinsics to immintrin.hBenjamin Kramer2012-07-121-0/+21
| | | | llvm-svn: 160118
* Distinguish more carefully between free functions and C++ instance methodsJohn McCall2012-07-071-3/+3
| | | | | | | | in the ABI arrangement, and leave a hook behind so that we can easily tweak CCs on platforms that use different CCs by default for C++ instance methods. llvm-svn: 159894
* Dead code eliminate the massive hexagon builtin intrinsic supporting code.Benjamin Kramer2012-06-281-2584/+0
| | | | | | | | The tablegen'd code does the same thing without this egregious duplication. In my limited testing everything seems to work, however there can be differences if the clang and llvm builtin definitions don't match. llvm-svn: 159371
* Now that we use the GCC builtin <-> llvm intrinsic, dead code eliminate the ↵Benjamin Kramer2012-06-281-298/+0
| | | | | | | | handwritten emitter. The generated code uncovered an invalid prototype for __builtin_mips_shilo, fix it along the way. llvm-svn: 159368
* Support MIPS DSP Rev1 intrinsics. Simon Atanasyan2012-06-281-0/+298
| | | | | | This patch was reviewed in the llvm-commits list by Jim Grosbach. llvm-svn: 159366
* If the first argument of __builtin_object_size can be folded to a constantRichard Smith2012-05-231-0/+4
| | | | | | | | pointer, but such folding encounters side-effects, ignore the side-effects rather than performing them at runtime: CodeGen generates wrong code for __builtin_object_size in that case. llvm-svn: 157310
* revert the usage of the objectsize intrinsic with 3 parameters (to match ↵Nuno Lopes2012-05-221-4/+1
| | | | | | LLVM r157255) llvm-svn: 157256
* Hexagon V5 intrinsics support in clang.Sirish Pande2012-05-111-155/+751
| | | | llvm-svn: 156630
* update calls to objectsize intrinsic to match LLVM r156473Nuno Lopes2012-05-091-2/+3
| | | | | | add a test for -fbounds-checking code generation llvm-svn: 156474
* Convert AVX non-temporal store builtins to LLVM-native IR. This was ↵Craig Topper2012-05-071-0/+3
| | | | | | previously done for SSE builtins. llvm-svn: 156296
* Revert r155363, due to the underlying patches in LLVM causing regressionChandler Carruth2012-04-231-749/+155
| | | | | | test suite failures. llvm-svn: 155371
* Hexagon V5 (floating point) support in cfe.Sirish Pande2012-04-231-155/+749
| | | | llvm-svn: 155363
* Revert some Hexagon builtin commits to match reverts done to LLVM inChandler Carruth2012-04-181-749/+155
| | | | | | | | | | | | | | | | | | | r155047. See the LLVM log for the primary motivation: http://llvm.org/viewvc/llvm-project?rev=155047&view=rev Primary commit r154828: - Several issues were raised in review, and fixed in subsequent commits. - Follow-up commits also reverted, and which should be folded into the original before reposting: - r154837: Re-add the 'undef BUILTIN' thing to fix the build. - r154928: Fix build warnings, re-add (and correct) header and license - r154937: Typo fix. Please resubmit this patch with the relevant LLVM resubmission. llvm-svn: 155048
* Hexagon V5(Floating Point) support.Sirish Pande2012-04-161-155/+749
| | | | llvm-svn: 154828
* Implement the missing pieces needed to support libstdc++4.7's <atomic>:Richard Smith2012-04-131-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | __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
* Provide, and document, a set of __c11_atomic_* intrinsics to implement C11'sRichard Smith2012-04-111-2/+5
| | | | | | | | | <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
* Don't try to create "store atomic" instructions of non-integer types; they ↵Eli Friedman2012-03-161-4/+5
| | | | | | aren't supported at the moment. PR12040. llvm-svn: 152891
* Fix codegen for vld{3,4}_dup intrinsics.James Molloy2012-03-151-4/+4
| | | | | | Patch by Silviu Baranga! llvm-svn: 152788
* add a testcase for PR12094 and fix a crash on pointer to incomplete type,Chris Lattner2012-03-041-3/+7
| | | | | | reported by Richard Smith. llvm-svn: 151993
* PR12094: Set the alignment of memory intrinsic instructions based on theJay Foad2012-03-021-29/+47
| | | | | | types of the pointer arguments. llvm-svn: 151927
* Use an ArrayRef when we can instead of passing in a SmallVectorImpl reference.Bill Wendling2012-02-221-1/+1
| | | | llvm-svn: 151150
* Add 3dNOW intrinsic header to x86intrin.h, conditioned on __3dNOW__ toChandler Carruth2012-02-201-0/+2
| | | | | | | | | | | | | | | | match the behavior of GCC. Also add a test for these intrinsics, which apparently have *zero* tests. =[ Not surprisingly, Clang crashed when compiling these. Fix the bug in CodeGen where we failed to bitcast the argument type to x86mmx prior to calling the LLVM intrinsic. This fixes an assert on the new 3dnow-builtins.c test. This is one issue impacting the efforts to get Clang to emulate the Microsoft intrinsics headers -- 3dnow intrinsics are implictitly made available there. llvm-svn: 150948
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-19/+17
| | | | | | CodeGenModule. llvm-svn: 149943
* Preserve alignment for Neon vld1_lane/dup and vst1_lane intrinsics.Bob Wilson2012-02-041-7/+17
| | | | | | | | We had been generating load/store instructions with the default alignment for the vector element type, even when the pointer argument had less alignment. <rdar://problem/10538555> llvm-svn: 149794
OpenPOWER on IntegriCloud