summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove long dead code for handling vector shift by immediate builtins.Craig Topper2012-01-301-107/+0
| | | | llvm-svn: 149237
* Remove custom handling for cmpsd/cmpss/cmppd/cmpps builtins. The builtins ↵Craig Topper2012-01-301-16/+0
| | | | | | are now in IntrinsicsX86.td. llvm-svn: 149235
* Cleanup 3dnow builtin handling. Most of them were already handled by LLVM ↵Craig Topper2012-01-301-117/+1
| | | | | | connecting intrinsics and builtins in IntrinsicsX86.td. llvm-svn: 149233
* Make the __builtin_c[lt]zs builtins target independent.Benjamin Kramer2012-01-281-26/+2
| | | | | | | | | There is really no reason to have these only available on x86. It's just __builtin_c[tl]z for shorts. Modernize the test while at it. llvm-svn: 149183
* Make clz/ctz builtins defined for zero on ARM targets. rdar://10732455Bob Wilson2012-01-261-2/+4
| | | | | | | | | | | | | | | | ARM supports clz and ctz directly and both operations have well-defined results for zero. There is no disadvantage in performance to using the defined-at-zero versions of llvm.ctlz/cttz intrinsics. We're running into ARM-specific code written with the assumption that __builtin_clz(0) == 32, even though that value is technically undefined. The code is failing now because of llvm optimizations that are taking advantage of the undef behavior (specifically svn r147255). There's nothing wrong with that optimization on x86 where any incorrect assumptions about __builtin_clz(0) will quickly be exposed. For ARM, though, optimizations based on that undef behavior are likely to cause subtle bugs. Other targets with defined-at-zero clz/ctz support may want to override the default behavior as well. llvm-svn: 149086
* reapply r148902:Chris Lattner2012-01-251-11/+7
| | | | | | | | | | "use the new ConstantVector::getSplat method where it makes sense." Also simplify a bunch of code to use the Builder->getInt32 instead of doing it the hard and ugly way. Much more progress could be made here, but I don't plan to do it. llvm-svn: 148926
* Revert 148902 which was part of 148901 which was reverted in r148906.Argyrios Kyrtzidis2012-01-251-7/+11
| | | | | | | Original log: use the new ConstantVector::getSplat method where it makes sense. llvm-svn: 148907
* use the new ConstantVector::getSplat method where it makes sense.Chris Lattner2012-01-251-11/+7
| | | | llvm-svn: 148902
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-1/+0
| | | | llvm-svn: 148577
* Add __builtin_labs and __builtin_llabs, to complete the set of ↵Eli Friedman2012-01-171-1/+3
| | | | | | __builtin_*abs. Patch by Ruben Van Boxem. llvm-svn: 148340
* Remove unnecessary default cases in switches over enums.David Blaikie2012-01-171-3/+2
| | | | | | This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
* Revert r147655; it's breaking the compiler_rt build on OSX.Eli Friedman2012-01-061-2/+1
| | | | llvm-svn: 147677
* If we are compiling with -fno-builtin then don't do constant folding ofDavid Chisnall2012-01-061-1/+2
| | | | | | | | builtins. This fixes PR11711. llvm-svn: 147655
* Small refactoring and simplification of constant evaluation and some of itsRichard Smith2011-12-281-1/+0
| | | | | | clients. No functionality change. llvm-svn: 147318
* Add intrinsics for lzcnt and tzcnt instructions.Craig Topper2011-12-251-0/+26
| | | | llvm-svn: 147263
* More AVX2 intrinsic support including saturating add/sub and palignr.Craig Topper2011-12-191-0/+38
| | | | llvm-svn: 146857
* Hexagon backend supportTony Linthicum2011-12-121-0/+1989
| | | | llvm-svn: 146413
* Update Clang to emit the new form of llvm.cttz and llvm.ctlz intrinsics,Chandler Carruth2011-12-121-3/+4
| | | | | | | | | setting the is_zero_undef flag appropriately to true as that matches the semantics of these GCC builtins. This is the Clang side of r146357 in LLVM. llvm-svn: 146358
* lib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.NAKAMURA Takumi2011-11-081-3/+3
| | | | llvm-svn: 144065
* Clean up type flags for overloaded Neon builtins. No functional change.Bob Wilson2011-11-081-29/+46
| | | | | | | | | This patch just adds a simple NeonTypeFlags class to replace the various hardcoded constants that had been used until now. Unfortunately I couldn't figure out a good way to avoid duplicating that class between clang and TableGen, but since it's small and rarely changes, that's not so bad. llvm-svn: 144054
* Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith2011-10-291-1/+1
| | | | | | | | implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
* Initial implementation of __atomic_* (everything except __atomic_is_lock_free).Eli Friedman2011-10-111-0/+66
| | | | llvm-svn: 141632
* Constant expression evaluation refactoring:Richard Smith2011-10-101-12/+9
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* llvm.memory.barrier is going away; remove the wrapper intrinsic ↵Eli Friedman2011-10-061-12/+0
| | | | | | | | __builtin_llvm_memory_barrier. __atomic_thread_fence will be landing soon as a replacement, wrapping around the new fence instruction. llvm-svn: 141332
* de-tmpify clang.Benjamin Kramer2011-09-271-25/+22
| | | | llvm-svn: 140637
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-9/+9
| | | | llvm-svn: 140367
* Fix comment.Eli Friedman2011-09-141-1/+1
| | | | llvm-svn: 139678
* Correctly generate IR for casted "builtin" functions, whereJohn McCall2011-09-131-7/+41
| | | | | | | the builtin is really just a predefined declaration. These are totally valid to cast. llvm-svn: 139657
* Re-commit r139643.Eli Friedman2011-09-131-5/+6
| | | | | | Make clang use Acquire loads and Release stores where necessary. llvm-svn: 139650
* Revert r139643 while I look into it; it's breaking selfhost.Eli Friedman2011-09-131-6/+5
| | | | llvm-svn: 139648
* Make clang use Acquire loads and Release stores where necessary.Eli Friedman2011-09-131-5/+6
| | | | llvm-svn: 139643
* Remove trailing } in comment.Julien Lerouge2011-09-091-1/+1
| | | | llvm-svn: 139424
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-0/+11
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Switch clang over to using fence/atomicrmw/cmpxchg instead of the intrinsics ↵Eli Friedman2011-09-071-65/+40
| | | | | | | | | | (which will go away). LLVM CodeGen does almost exactly the same thing with these and the old intrinsics, so I'm reasonably confident this will not break anything. There are still a few issues which need to be resolved with code generation for atomic load and store, so I'm not converting the places which need those for now. I'm not entirely sure what to do about __builtin_llvm_memory_barrier: the fence instruction doesn't expose all the possibilities which can be expressed by __builtin_llvm_memory_barrier. I would appreciate hearing from anyone who is using this intrinsic. llvm-svn: 139216
* Fix a handful of dead stores found by Clang's static analyzer. There's a ↵Ted Kremenek2011-08-171-2/+2
| | | | | | bunch of others I haven't touched. llvm-svn: 137867
* Move handling of vget_lane/vset_lane before the code that checks the type.Bob Wilson2011-08-131-24/+31
| | | | | | | | | Unlike most of the other Neon intrinsics, these are not overloaded and do not have the extra argument that specifies the vector type. This has not been fatal because the lane number operand is supposed to be an ICE and so that value has harmlessly been used as the type identifier. Radar 9901281. llvm-svn: 137550
* Remove some unnecessary single element array temporaries.Jay Foad2011-07-291-2/+1
| | | | llvm-svn: 136461
* Shorten some expressions by using ArrayRef::slice().Frits van Bommel2011-07-251-6/+3
| | | | llvm-svn: 135910
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-8/+8
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Migrate LLVM and Clang to use the new makeArrayRef(...) functions where ↵Frits van Bommel2011-07-181-8/+5
| | | | | | | | previously explicit non-default constructors were used. Mostly mechanical with some manual reformatting. llvm-svn: 135390
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-36/+36
| | | | llvm-svn: 135370
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-29/+33
| | | | llvm-svn: 135265
* Change intrinsic getter to take an ArrayRef, now that the underlying ↵Benjamin Kramer2011-07-141-97/+94
| | | | | | function in LLVM does. llvm-svn: 135155
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-36/+35
| | | | llvm-svn: 134831
* Introduce __builtin_expect() intrinsic support.Jakub Staszak2011-07-081-4/+10
| | | | llvm-svn: 134761
* Add codegen support for the fma/fmal/fmaf builtins.Cameron Zwarich2011-07-081-0/+16
| | | | llvm-svn: 134743
* Revert "Shorten some ARM builtin names by removing unnecessary "neon" prefix."Bob Wilson2011-06-241-197/+197
| | | | | | | | Sorry, this was a bad idea. Within clang these builtins are in a separate "ARM" namespace, but the actual builtin names should clearly distinguish tha they are target specific. llvm-svn: 133833
* Shorten some ARM builtin names by removing unnecessary "neon" prefix.Bob Wilson2011-06-241-197/+197
| | | | llvm-svn: 133826
* update for api change.Chris Lattner2011-06-181-2/+1
| | | | llvm-svn: 133365
* Update the prefetch intrinsic usage. Now the last argument tells codegenBruno Cardoso Lopes2011-06-141-1/+2
| | | | | | whether it's a data or instruction cache access. llvm-svn: 132977
OpenPOWER on IntegriCloud