summaryrefslogtreecommitdiff
path: root/lib/CodeGen/IntrinsicLowering.cpp
Commit message (Collapse)AuthorAge
...
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-11
| | | | | | | and abort()/exit() -> llvm_report_error(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContext _back_ through IRBuilder.Owen Anderson2009-07-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75040 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of these cache variables, which are a holdover from the days whenOwen Anderson2009-06-26
| | | | | | | we had multiple type planes and these lookups were expensive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74319 91177308-0d34-0410-b5e6-96231b3b80d8
* Now with EVEN FEWER statics!Owen Anderson2009-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74143 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch to using IRBuilder throughout.Jay Foad2009-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71587 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't generate redundant casts of constant values when lowering calls toJay Foad2009-05-11
| | | | | | memcpy, memmove and memset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71427 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-07
| | | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing break statements, fixing PR3503.Chris Lattner2009-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64040 91177308-0d34-0410-b5e6-96231b3b80d8
* As Duncan suggested, add braces for the one-line "else branch".Zhou Sheng2009-01-30
| | | | | | | Thanks, Duncan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63389 91177308-0d34-0410-b5e6-96231b3b80d8
* This is to fix the bug in IntrinsicLowering.cpp,Zhou Sheng2009-01-30
| | | | | | | | | the LowerPartSet(). It didn't handle the situation correctly when the low, high argument values are in reverse order (low > high) with 'Val' type i32 (a corner case). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63388 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply Sanjiv's patch to genericize memcpy/memset/memmove to take anChris Lattner2008-11-21
| | | | | | | arbitrary integer width for the count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r59802. It was breaking the build of llvm-gcc:Bill Wendling2008-11-21
| | | | | | | | | | | | | | | | | | | | | | | g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o ../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)': ../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)': ../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)': ../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic' ../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic' make[3]: *** [llvm-convert.o] Error 1 make[3]: *** Waiting for unfinished jobs.... rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod make[2]: *** [all-stage1-gcc] Error 2 make[1]: *** [stage1-bubble] Error 2 make: *** [all] Error 2 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59809 91177308-0d34-0410-b5e6-96231b3b80d8
* Make mem[cpy,move,set] intrinsics overloaded.Sanjiv Gupta2008-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59802 91177308-0d34-0410-b5e6-96231b3b80d8
* More refactoring. Yawn.Dale Johannesen2008-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56468 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor FP intrinisic setup. Per review feedback.Dale Johannesen2008-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56456 91177308-0d34-0410-b5e6-96231b3b80d8
* Add intrinsics for log, log2, log10, exp, exp2.Dale Johannesen2008-09-04
| | | | | | | | No functional change (and no FE change to generate them). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55753 91177308-0d34-0410-b5e6-96231b3b80d8
* API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif2008-05-16
| | | | | | Legacy interfaces will be in place for some time. (Merge from use-diet branch.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-06
| | | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-17
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement necessary bits for flt_rounds gcc builtin. Anton Korobeynikov2007-11-15
| | | | | | | Codegen bits and llvm-gcc support will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44182 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach IntrinsicLowering.cpp about the sin, cos, and pow intrinsics.Dan Gohman2007-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43020 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite sqrt and powi to use anyfloat. By popular demand.Dale Johannesen2007-10-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42537 91177308-0d34-0410-b5e6-96231b3b80d8
* minor long double related changesDale Johannesen2007-09-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42439 91177308-0d34-0410-b5e6-96231b3b80d8
* Split eh.select / eh.typeid.for intrinsics into i32/i64 versions. This is ↵Anton Korobeynikov2007-09-07
| | | | | | | | | needed, because they just "mark" register liveins and we let frontend solve type issue, not lowering code :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41763 91177308-0d34-0410-b5e6-96231b3b80d8
* Add lengthof and endof templates that hide a lot of sizeof computations.Owen Anderson2007-09-07
| | | | | | | Patch by Sterling Stein! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41758 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a regression compiling 2005-05-11-Popcount-ffs-fls with the CBE,Chris Lattner2007-08-06
| | | | | | | introduced by chandler's patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40864 91177308-0d34-0410-b5e6-96231b3b80d8
* New CallInst interface to address GLIBCXX_DEBUG errors caused byDavid Greene2007-08-01
| | | | | | | | | indexing an empty std::vector. Updates to all clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
* The exception handling intrinsics return values,Duncan Sands2007-07-06
| | | | | | | | | | | | | | so must be lowered to a value, not nothing at all. Subtle point: I made eh_selector return 0 and eh_typeid_for return 1. This means that only cleanups (destructors) will be run as the exception unwinds [if eh_typeid_for returned 0 then it would be as if the first catch always matched, and the corresponding handler would be run], which is probably want you want in the CBE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37947 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend eh.selector to support both catches and filters.Duncan Sands2007-07-04
| | | | | | | Drop the eh.filter intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37875 91177308-0d34-0410-b5e6-96231b3b80d8
* Codegen support (stripped out) for the annotate attribute.Tanya Lattner2007-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37608 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in bswap lowering.Lauro Ramos Venancio2007-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37544 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LowerCTPOP() support arbitrary bitwidth integer type.Zhou Sheng2007-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37397 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct the logic in LowerPartSet which cleared the bits from 0 to low-1.Zhou Sheng2007-05-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37331 91177308-0d34-0410-b5e6-96231b3b80d8
* Un-brain-dead-ify the lowering of part set for the reverse case.Reid Spencer2007-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37071 91177308-0d34-0410-b5e6-96231b3b80d8
* Give names to the final result values of the part_set computations. ThisReid Spencer2007-05-14
| | | | | | | just aids in readability and debugability of the output. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37037 91177308-0d34-0410-b5e6-96231b3b80d8
* Get the size of auto arrays right, regardless of its changing size.Reid Spencer2007-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37006 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix problems in the PartSet lowering having to do with incorrect bit width.Reid Spencer2007-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36180 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure intrinsics that are lowered to functions make the function weakReid Spencer2007-04-12
| | | | | | | | linkage so we only end up with one of them in a program. These are, after all overloaded and templatish in nature. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35956 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugs in generated code for part_select and part_set so that llc doesn'tReid Spencer2007-04-12
| | | | | | | barf when CBE is run with a program that contains these intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35946 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in PartSet. The replacement value needs to be zext or trunc toReid Spencer2007-04-12
| | | | | | | the size of the value, not just zext. Also, give better names to two BBs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35945 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1284:Reid Spencer2007-04-12
| | | | | | | Implement the "part_set" intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35938 91177308-0d34-0410-b5e6-96231b3b80d8
* apparently some people commit without building the tree, or they forget toChris Lattner2007-04-10
| | | | | | | commit a LOT of files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35858 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.Reid Spencer2007-04-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35678 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1297:Reid Spencer2007-04-02
| | | | | | | | Make sure that the CTPOP result is casted to i32 as the bit counting intrinsics all return i32 now (this affects CTLZ and CTTZ as well). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35567 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1297:Reid Spencer2007-04-01
| | | | | | | Support overloaded intrinsics bswap, ctpop, cttz, ctlz. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35547 91177308-0d34-0410-b5e6-96231b3b80d8
* Lower eh filter intrinsic.Jim Laskey2007-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34802 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a more meaningful name.Jim Laskey2007-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34751 91177308-0d34-0410-b5e6-96231b3b80d8
* Update comment.Jim Laskey2007-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34502 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove assertion.Jim Laskey2007-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34494 91177308-0d34-0410-b5e6-96231b3b80d8