summaryrefslogtreecommitdiff
path: root/include/llvm/Constants.h
Commit message (Collapse)AuthorAge
...
* Add an END_WITH_NULL accessor for ConstantStruct.Talin2011-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126714 91177308-0d34-0410-b5e6-96231b3b80d8
* convert ConstantVector::get to use ArrayRef.Chris Lattner2011-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125537 91177308-0d34-0410-b5e6-96231b3b80d8
* revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner2011-02-14
| | | | | | | builders unhappy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125504 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch ConstantVector::get to use ArrayRef instead of a pointer+sizeChris Lattner2011-02-14
| | | | | | | idiom. Change various clients to simplify their code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125487 91177308-0d34-0410-b5e6-96231b3b80d8
* make the constantexpr interfaces for inbounds GEPs follow the same styleChris Lattner2011-02-11
| | | | | | | as other constantexpr flags, reducing redundancy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125365 91177308-0d34-0410-b5e6-96231b3b80d8
* switch the constantexpr, target folder, and IRBuilder interfacesChris Lattner2011-02-10
| | | | | | | | for NSW/NUW binops to follow the pattern of exact binops. This allows someone to use Builder.CreateAdd(x, y, "tmp", MaybeNUW); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125270 91177308-0d34-0410-b5e6-96231b3b80d8
* refactor ConstantExpr interfaces a bit around "exactness".Chris Lattner2011-02-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125190 91177308-0d34-0410-b5e6-96231b3b80d8
* implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.Chris Lattner2011-02-07
| | | | | | | Factor some code better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125006 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance vmcore to know that udiv's can be exact, and add a trivialChris Lattner2011-02-06
| | | | | | | | | | instcombine xform to exercise this. Nothing forms exact udivs yet though. This is progress on PR8862 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124992 91177308-0d34-0410-b5e6-96231b3b80d8
* Have m_One also match constant vectors for which every element is 1.Duncan Sands2011-02-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124655 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove casts between Value** and Constant**, which won't work if aJay Foad2011-01-14
| | | | | | | static_cast from Constant* to Value* has to adjust the "this" pointer. This is groundwork for PR889. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123435 91177308-0d34-0410-b5e6-96231b3b80d8
* FixedNumOperandTraits and VariadicOperandTraits assumed that, given aJay Foad2011-01-11
| | | | | | | | | | | "this" pointer for any subclass of User, you could static_cast it to User* and then reinterpret_cast that to Use* to get the end of the operand list. This isn't a safe assumption in general, because the static_cast might adjust the "this" pointer. Fixed by having these OperandTraits classes take an extra template parameter, which is the subclass of User. This is groundwork for PR889. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123235 91177308-0d34-0410-b5e6-96231b3b80d8
* clarify commentChris Lattner2010-12-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120772 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune includes.Benjamin Kramer2010-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113850 91177308-0d34-0410-b5e6-96231b3b80d8
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-28
| | | | | | | being actively maintained, improved, or extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comments about undef.Dan Gohman2010-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103834 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete an obsolete comment.Dan Gohman2010-05-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103420 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more information to the getSizeOf comment.Dan Gohman2010-02-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97140 91177308-0d34-0410-b5e6-96231b3b80d8
* When forming SSE min and max nodes for UGE and ULE comparisons, it'sDan Gohman2010-02-24
| | | | | | | | | | | | necessary to swap the operands to handle NaN and negative zero properly. Also, reintroduce logic for checking for NaN conditions when forming SSE min and max instructions, fixed to take into consideration NaNs and negative zeros. This allows forming min and max instructions in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97025 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a union type in LLVM IR. Patch by Talin!Chris Lattner2010-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding missing methods for creating Add, Mul, Neg and Sub with NUW.Duncan Sands2010-02-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95086 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a getNUWMul function.Dan Gohman2010-02-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94982 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a generalized form of ConstantExpr::getOffsetOf which works forDan Gohman2010-02-01
| | | | | | | | array types as well as struct types, and which accepts arbitrary Constant indicies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94981 91177308-0d34-0410-b5e6-96231b3b80d8
* Make getAlignOf return an i64, for consistency with getSizeOf andDan Gohman2010-01-28
| | | | | | | | getOffsetOf, and remove the comment about assuming i8 is byte-aligned, which is no longer applicable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94738 91177308-0d34-0410-b5e6-96231b3b80d8
* add a layer of accessors around the Value::SubClassData member, and use Chris Lattner2009-12-29
| | | | | | | | | | | | | a convention (shadowing the setter with private forwarding function) to prevent subclasses from accidentally using it. This exposed some bogosity in ConstantExprs, which was propaging the opcode of the constant expr into the NUW/NSW/Exact field in the getWithOperands/getWithOperandReplaced methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8
* Add utility routines for NSW multiply.Dan Gohman2009-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91664 91177308-0d34-0410-b5e6-96231b3b80d8
* Add utility routines for creating integer negation operators with NSW set.Dan Gohman2009-12-18
| | | | | | | Integer negation only overflows with INT_MIN, but that's an important case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91662 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass StringRef by value.Daniel Dunbar2009-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 85678/85680. The decision is to stay with the current form of Chris Lattner2009-11-01
| | | | | | | | indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it for simplicity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85699 91177308-0d34-0410-b5e6-96231b3b80d8
* Make blockaddress(@func, null) be valid, and make 'deleting a basic Chris Lattner2009-10-31
| | | | | | | | | | | | | block with a blockaddress still referring to it' replace the invalid blockaddress with a new blockaddress(@func, null) instead of a inttoptr(1). This changes the bitcode encoding format, and still needs codegen support (this should produce a non-zero value, referring to the entry block of the function would also be quite reasonable). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85678 91177308-0d34-0410-b5e6-96231b3b80d8
* Previously, all operands to Constant were themselves constant.Chris Lattner2009-10-28
| | | | | | | | | | In the new world order, BlockAddress can have a BasicBlock operand. This doesn't permute much, because if you have a ConstantExpr (or anything more specific than Constant) we still know the operand has to be a Constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85375 91177308-0d34-0410-b5e6-96231b3b80d8
* IR support for the new BlockAddress constant kind. This isChris Lattner2009-10-28
| | | | | | | | untested and there is no way to use it, next up: doing battle with asmparser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85349 91177308-0d34-0410-b5e6-96231b3b80d8
* Random #include pruning.Benjamin Kramer2009-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84632 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bunch of bad formatting, delete the dead Chris Lattner2009-10-11
| | | | | | | ConstantInt::TheTrueVal/TheFalseVal members. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83752 91177308-0d34-0410-b5e6-96231b3b80d8
* For the NSWSub support in the builder to actually be useable,Duncan Sands2009-09-26
| | | | | | | | there need to be corresponding changes to the constant folders, done in this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82862 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ConstantFP's getInf to getInfinity.Dan Gohman2009-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82823 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a ConstantFP::getInf utility function for creating infinity ConstantFPs.Dan Gohman2009-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82818 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the default value for ConstantStruct::get's isPacked parameter andNick Lewycky2009-09-19
| | | | | | | update the code which was broken by this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82327 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out the code for checking that all indices in a getelementptr areDan Gohman2009-09-10
| | | | | | | | | | within the notional bounds of the static type of the getelementptr (which is not the same as "inbounds") from GlobalOpt into a utility routine, and use it in ConstantFold.cpp to check whether there are any mis-behaved indices. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81478 91177308-0d34-0410-b5e6-96231b3b80d8
* Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.Dan Gohman2009-09-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81172 91177308-0d34-0410-b5e6-96231b3b80d8
* Public and private corrections, warned about by icc (#304).Duncan Sands2009-09-06
| | | | | | | Patch by Erick Tryzelaar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81107 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", thisDaniel Dunbar2009-09-06
| | | | | | breaks MiniSAT on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81098 91177308-0d34-0410-b5e6-96231b3b80d8
* Include optional subclass flags, such as inbounds, nsw, etc., in theDan Gohman2009-09-04
| | | | | | | | | | | | | | | | | | Constant uniquing tables. This allows distinct ConstantExpr objects with the same operation and different flags. Even though a ConstantExpr "a + b" is either always overflowing or never overflowing (due to being a ConstantExpr), it's still necessary to be able to represent it both with and without overflow flags at the same time within the IR, because the safety of the flag may depend on the context of the use. If the constant really does overflow, it wouldn't ever be safe to use with the flag set, however the use may be in code that is never actually executed. This also makes it possible to merge all the flags tests into a single test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80998 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 80959. It isn't sufficient to solve the full problem. And itDan Gohman2009-09-03
| | | | | | | introduced regressions in the Ocaml bindings tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80969 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,Dan Gohman2009-09-03
| | | | | | | | | | | | | | | | and exact flags. Because ConstantExprs are uniqued, creating an expression with this flag causes all expressions with the same operands to have the same flag, which may not be safe. Add, sub, mul, and sdiv ConstantExprs are usually folded anyway, so the main interesting flag here is inbounds, and the constant folder already knows how to set the inbounds flag automatically in most cases, so there isn't an urgent need for the API support. This can be reconsidered in the future, but for now just removing these API bits eliminates a source of potential trouble with little downside. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80959 91177308-0d34-0410-b5e6-96231b3b80d8
* Now Bitcode reader bug is fixed. Reapply 80839.Devang Patel2009-09-03
| | | | | | | | | | Use CallbackVH, instead of WeakVH, to hold MDNode elements. Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80868 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 80839 for now. It causes test failures.Devang Patel2009-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80841 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CallbackVH, instead of WeakVH, to hold MDNode elements. Devang Patel2009-09-02
| | | | | | | | | Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80839 91177308-0d34-0410-b5e6-96231b3b80d8
* Add helper functions to ConstantInt and ConstantFP to accept strings.Erick Tryzelaar2009-08-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79212 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a getOffsetOf, for building a target-independent expression forDan Gohman2009-08-16
| | | | | | | offsetof, similar to getSizeOf for sizeof. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79208 91177308-0d34-0410-b5e6-96231b3b80d8