summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plusJay Foad2011-04-131-3/+3
| | | | | | related tweaks to ExprMapKeyType. llvm-svn: 129443
* Remove some redundant llvm:: prefixes.Jay Foad2011-04-131-1/+1
| | | | llvm-svn: 129441
* PR9214: Convert ConstantExpr::getWithOperands() to use ArrayRef.Jay Foad2011-04-131-5/+5
| | | | llvm-svn: 129439
* ConstantInt has some getters which return ConstantInt's or ConstantVector's ofNick Lewycky2011-03-061-6/+31
| | | | | | | | the value splatted into every element. Extend this to getTrue and getFalse which by providing new overloads that take Types that are either i1 or <N x i1>. Use it in InstCombine to add vector support to some code, fixing PR8469! llvm-svn: 127116
* Added missing va_end().Talin2011-03-011-0/+1
| | | | llvm-svn: 126759
* Add an END_WITH_NULL accessor for ConstantStruct.Talin2011-02-281-2/+13
| | | | llvm-svn: 126714
* hoist GlobalValue::removeDeadConstantUsers up to being a method on Constant.Chris Lattner2011-02-181-0/+53
| | | | llvm-svn: 125828
* Enhance constant folding of bitcast operations on vectors of floats.Nadav Rotem2011-02-171-1/+7
| | | | | | | Add getAllOnesValue of FP numbers to Constants and APFloat. Add more tests. llvm-svn: 125776
* convert ConstantVector::get to use ArrayRef.Chris Lattner2011-02-151-20/+15
| | | | llvm-svn: 125537
* revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner2011-02-141-15/+20
| | | | | | builders unhappy. llvm-svn: 125504
* Switch ConstantVector::get to use ArrayRef instead of a pointer+sizeChris Lattner2011-02-141-20/+15
| | | | | | idiom. Change various clients to simplify their code. llvm-svn: 125487
* make ConstantExpr::replaceUsesOfWithOnConstant preserve the inboundsChris Lattner2011-02-111-1/+2
| | | | | | flag. Noticed by Jin Gu Kang! llvm-svn: 125366
* make the constantexpr interfaces for inbounds GEPs follow the same styleChris Lattner2011-02-111-63/+10
| | | | | | as other constantexpr flags, reducing redundancy. llvm-svn: 125365
* switch the constantexpr, target folder, and IRBuilder interfacesChris Lattner2011-02-101-67/+24
| | | | | | | for NSW/NUW binops to follow the pattern of exact binops. This allows someone to use Builder.CreateAdd(x, y, "tmp", MaybeNUW); llvm-svn: 125270
* refactor ConstantExpr interfaces a bit around "exactness".Chris Lattner2011-02-091-29/+12
| | | | llvm-svn: 125190
* fix comment change.Chris Lattner2011-02-071-1/+1
| | | | llvm-svn: 125047
* implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.Chris Lattner2011-02-071-53/+74
| | | | | | Factor some code better. llvm-svn: 125006
* enhance vmcore to know that udiv's can be exact, and add a trivialChris Lattner2011-02-061-1/+6
| | | | | | | | instcombine xform to exercise this. Nothing forms exact udivs yet though. This is progress on PR8862 llvm-svn: 124992
* Have m_One also match constant vectors for which every element is 1.Duncan Sands2011-02-011-1/+1
| | | | llvm-svn: 124655
* Fix indentation.Jay Foad2011-01-271-9/+9
| | | | llvm-svn: 124375
* Remove casts between Value** and Constant**, which won't work if aJay Foad2011-01-141-13/+28
| | | | | | | static_cast from Constant* to Value* has to adjust the "this" pointer. This is groundwork for PR889. llvm-svn: 123435
* Apparently APFloat::getZero doesn't like PPCDoubleDoubles.Benjamin Kramer2010-12-041-1/+1
| | | | llvm-svn: 120909
* Simplify code. No functionality change.Benjamin Kramer2010-12-041-6/+9
| | | | llvm-svn: 120907
* Simplify code. No change in functionality.Benjamin Kramer2010-11-201-10/+6
| | | | llvm-svn: 119908
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-281-80/+1
| | | | | | being actively maintained, improved, or extended. llvm-svn: 112356
* Prefix `next' iterator operation with `llvm::'.Oscar Fuentes2010-08-021-1/+1
| | | | | | | | Fixes potential ambiguity problems on VS 2010. Patch by nobled! llvm-svn: 110029
* Preallocate vector, avoid unnecessary vector growth.Benjamin Kramer2010-08-011-0/+1
| | | | llvm-svn: 109971
* Fix PR7658, a problem where type refinement can triggerChris Lattner2010-07-171-24/+21
| | | | | | | | constant replacement which was botching its handling of types. Use of getType() instead of getRawType() was causing the type map in constant folding to be updated wrong. llvm-svn: 108610
* Remove the API compatibility layer which converted add, sub, and mulDan Gohman2010-05-031-9/+0
| | | | | | | | to fadd, fsub, and fmul, when used with a floating-point type. LLVM has supported the new instructions since 2.6, so it's time to get on board. llvm-svn: 102971
* Simplify this code.Dan Gohman2010-04-121-14/+14
| | | | llvm-svn: 101074
* move some method definitions to files that make sense.Chris Lattner2010-03-301-0/+14
| | | | llvm-svn: 99927
* add support for zero initialized unions, patch by Tim Northover!Chris Lattner2010-03-291-1/+3
| | | | llvm-svn: 99818
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-251-1/+1
| | | | llvm-svn: 99564
* replaceUsesOfWithOnConstant implementation for unions.Talin2010-02-181-1/+46
| | | | llvm-svn: 96616
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-10/+10
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-40/+40
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Add support for a union type in LLVM IR. Patch by Talin!Chris Lattner2010-02-121-0/+33
| | | | llvm-svn: 96011
* Adding missing methods for creating Add, Mul, Neg and Sub with NUW.Duncan Sands2010-02-021-2/+18
| | | | llvm-svn: 95086
* eliminate a bunch of pointless LLVMContext arguments.Chris Lattner2010-02-011-27/+15
| | | | llvm-svn: 95001
* Add a getNUWMul function.Dan Gohman2010-02-011-0/+5
| | | | llvm-svn: 94982
* Add a generalized form of ConstantExpr::getOffsetOf which works forDan Gohman2010-02-011-4/+9
| | | | | | | array types as well as struct types, and which accepts arbitrary Constant indicies. llvm-svn: 94981
* Make getAlignOf return an i64, for consistency with getSizeOf andDan Gohman2010-01-281-2/+2
| | | | | | | getOffsetOf, and remove the comment about assuming i8 is byte-aligned, which is no longer applicable. llvm-svn: 94738
* Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their placeDan Gohman2010-01-281-2/+2
| | | | | | | | | | | | | | | | use plain SCEVUnknowns with ConstantExpr::getSizeOf and ConstantExpr::getOffsetOf constants. This eliminates a bunch of special-case code. Also add code for pattern-matching these expressions, for clients that want to recognize them. Move ScalarEvolution's logic for expanding array and vector sizeof expressions into an element count times the element size, to expose the multiplication to subsequent folding, into the regular constant folder. llvm-svn: 94737
* fix CastInst::castIsValid to reject aggregate types, fixing PR6153:Chris Lattner2010-01-261-30/+18
| | | | | | | | llvm-as: t.ll:1:25: error: invalid cast opcode for cast from '[4 x i8]' to '[1 x i32]' @x = constant [1 x i32] bitcast ([4 x i8] c"abcd" to [1 x i32]) ^ llvm-svn: 94595
* Fix a crasher trying to fold each element in a comparison between two vectorsNick Lewycky2010-01-211-7/+13
| | | | | | | | | | if one of the vectors didn't have elements (such as undef). Fixes PR 6096. Fix an issue in the constant folder where fcmp (<2 x %ty>, <2 x %ty>) would have <2 x i1> type if constant folding was successful and i1 type if it wasn't. This exposed a related issue in the bitcode reader. llvm-svn: 94069
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-051-2/+2
| | | | llvm-svn: 92771
* Convert a ton of simple integer type equality tests to the new predicate.Benjamin Kramer2010-01-051-2/+2
| | | | llvm-svn: 92760
* Change errs() to dbgs().David Greene2010-01-051-1/+1
| | | | llvm-svn: 92650
* differences between two blockaddress's don't cause a Chris Lattner2010-01-031-0/+18
| | | | | | global variable initializer to require relocations. llvm-svn: 92450
OpenPOWER on IntegriCloud