summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantFold.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add a "loses information" return value to APFloat::convertDale Johannesen2008-10-091-2/+4
| | | | | | | and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. llvm-svn: 57329
* Rename APFloat::convertToAPInt to bitcastToAPInt toDale Johannesen2008-10-091-2/+2
| | | | | | | make it clearer what the function does. No functional change. llvm-svn: 57325
* Try to fold each element of a vector. This is needed to maintain structuralNick Lewycky2008-09-031-12/+4
| | | | | | equivalence. llvm-svn: 55694
* Don't crash when trying to constant fold a vector with some elements that can'tNick Lewycky2008-09-031-6/+12
| | | | | | | | | be folded. Instead, fail to fold the entire vector. We could also return a vector with some elements folded and some not. If anyone thinks that's a better approach, please speak up! llvm-svn: 55689
* Fix a case where vector comparison constant folding would cause anChris Lattner2008-07-101-33/+33
| | | | | | infinite recursion. part of PR2529 llvm-svn: 53383
* elementwise comparison of vector constants was completely wrong. FixChris Lattner2008-07-101-19/+32
| | | | | | it for PR2529 llvm-svn: 53380
* improve commentChris Lattner2008-07-081-1/+1
| | | | llvm-svn: 53243
* Fix three bugs:Chris Lattner2008-07-081-56/+101
| | | | | | | | | | | 1) evaluate [v]fcmp true/false with undefs to true or false instead of undef. 2) fix vector comparisons with undef to return a vector result instead of i1 3) fix vector comparisons with evaluatable results to return vector true/false instead of i1 true/false (PR2529) llvm-svn: 53220
* Constant folding for insertvalue and extractvalue.Dan Gohman2008-06-031-10/+105
| | | | llvm-svn: 51889
* Revert constant-folding change that will miscompile in some cases.Nick Lewycky2008-05-171-23/+0
| | | | llvm-svn: 51223
* Unbreak the build.Nick Lewycky2008-05-171-1/+1
| | | | llvm-svn: 51217
* Constant fold inttoptr and ptrtoint.Nick Lewycky2008-05-171-0/+23
| | | | llvm-svn: 51216
* IR support for extractvalue and insertvalue instructions. Also, beginDan Gohman2008-05-151-4/+17
| | | | | | moving toward making structs and arrays first-class types. llvm-svn: 51157
* merge of use-diet branch to trunkGabor Greif2008-05-101-8/+8
| | | | llvm-svn: 50943
* hopefully resolve PR2240Chris Lattner2008-04-201-1/+1
| | | | llvm-svn: 49999
* rearrange some code, simplify handling of shifts.Chris Lattner2008-04-201-60/+56
| | | | llvm-svn: 49995
* Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with ↵Chris Lattner2008-04-201-13/+17
| | | | | | long doubles. llvm-svn: 49976
* Implement PR2206.Chris Lattner2008-04-191-8/+17
| | | | llvm-svn: 49967
* refactor handling of symbolic constant folding, picking upChris Lattner2008-04-191-62/+62
| | | | | | | a few new cases( see Integer/a1.ll), but not anything that would happen in practice. llvm-svn: 49965
* indentation fix.Chris Lattner2008-04-191-14/+14
| | | | llvm-svn: 49964
* Don't eliminate bitcast instructions that change the type of a pointerNate Begeman2008-03-311-19/+21
| | | | llvm-svn: 48971
* Handle a special case xor undef, undef -> 0. Technically this should be ↵Evan Cheng2008-03-251-1/+6
| | | | | | transformed to undef. But this is such a common idiom (misuse) we are going to handle it. llvm-svn: 48792
* Use the new convertFromAPInt instead of convertFromZeroExtendedInteger.Dan Gohman2008-02-291-6/+3
| | | | llvm-svn: 47744
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-7/+14
| | | | | | annoying warnings. llvm-svn: 47367
* Fix some minor issues folding undef, PR2052Chris Lattner2008-02-191-1/+3
| | | | llvm-svn: 47314
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-4/+7
| | | | | | 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. llvm-svn: 45082
* Teach VMCore to constant fold shufflevectors with constant operands.Chris Lattner2007-12-111-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to compile: #include <emmintrin.h> typedef __m128i VSInt16; typedef short vSInt16 __attribute__ ((__vector_size__ (16))); VSInt16 t3() { return (VSInt16)((vSInt16)_mm_set1_epi16(6518)); } into: _t3: movaps LCPI1_0, %xmm0 ret instead of: _t3: movl $6518, %eax movd %eax, %xmm0 pextrw $0, %xmm0, %eax xorps %xmm0, %xmm0 pinsrw $0, %eax, %xmm0 punpcklwd %xmm0, %xmm0 pshufd $0, %xmm0, %xmm0 ret llvm-svn: 44856
* significantly simplify some code, no functionality change.Chris Lattner2007-12-111-88/+23
| | | | llvm-svn: 44850
* refactor some code, no functionality change.Chris Lattner2007-12-111-94/+96
| | | | llvm-svn: 44849
* Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.Chris Lattner2007-12-101-11/+10
| | | | | | | | Reimplement the xform in Analysis/ConstantFolding.cpp where we can use targetdata to validate that it is safe. While I'm in there, fix some const correctness issues and generalize the interface to the "operand folder". llvm-svn: 44817
* Add support for vectors to int <-> float casts.Nate Begeman2007-11-171-0/+18
| | | | llvm-svn: 44204
* Fix a regression in test/CodeGen/X86/2007-04-24-VectorCrash.ll introducedDan Gohman2007-10-311-4/+3
| | | | | | | by r43510. Gracefully handle constants with vector type that aren't ConstantVector or ConstantAggregateZero. llvm-svn: 43579
* Add support for folding binary operators with vector zero operands.Dan Gohman2007-10-301-19/+29
| | | | llvm-svn: 43510
* Disable attempts to constant fold PPC f128.Dale Johannesen2007-10-161-0/+4
| | | | | | | Remove the assumption that this will happen from various places. llvm-svn: 43053
* avoid an APFloat copy.Chris Lattner2007-10-151-1/+1
| | | | llvm-svn: 42979
* Disable some compile-time optimizations on PPCDale Johannesen2007-10-141-0/+12
| | | | | | long double. llvm-svn: 42958
* convertFromInteger, as originally written, expected sign-extendedNeil Booth2007-10-071-1/+1
| | | | | | | | input. APInt unfortunately zero-extends signed integers, so Dale modified the function to expect zero-extended input. Make this assumption explicit in the function name. llvm-svn: 42732
* Constant fold int-to-long-double conversions;Dale Johannesen2007-09-301-17/+9
| | | | | | | | use APFloat for int-to-float/double; use round-to-nearest for these (implementation-defined, seems to match gcc). llvm-svn: 42484
* Remove no-longer-used variable.Dale Johannesen2007-09-251-3/+2
| | | | llvm-svn: 42329
* Make APFloat->int conversions deterministic even inDale Johannesen2007-09-251-2/+0
| | | | | | cases with undefined behavior. llvm-svn: 42328
* float->int conversion rounds toward 0. Duh.Dale Johannesen2007-09-241-1/+1
| | | | | | Fixes PR1698. llvm-svn: 42273
* Just use APFloat for const / const. FixesDale Johannesen2007-09-241-17/+0
| | | | | | -1. / -0. llvm-svn: 42254
* Fix dumb regression in constant folding (Regression/C/casts)Dale Johannesen2007-09-201-1/+1
| | | | llvm-svn: 42165
* Fix some long double issues.Dale Johannesen2007-09-191-19/+21
| | | | llvm-svn: 42133
* Partial fix for PR1678: correct some parts of constantDuncan Sands2007-09-191-2/+4
| | | | | | | fold that were missed in the fix for PR1646. Probably this null/not-null logic should be factorized somewhere. llvm-svn: 42131
* Revise previous patch per review comments.Dale Johannesen2007-09-121-7/+6
| | | | | | | Next round of x87 long double stuff. Getting close now, basically works. llvm-svn: 41875
* Add APInt interfaces to APFloat (allows directlyDale Johannesen2007-09-111-13/+8
| | | | | | | | | access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). llvm-svn: 41858
* Fix a buggy constant folding transformation when handling aliases.Chris Lattner2007-09-101-4/+7
| | | | llvm-svn: 41818
* Next round of APFloat changes.Dale Johannesen2007-09-061-66/+97
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
OpenPOWER on IntegriCloud