aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/InstrTypes.h
Commit message (Collapse)AuthorAgeFilesLines
* Add some missing anchors.David Blaikie2011-12-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145578 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-40/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-111-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129271 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/ExactChris Lattner2011-02-091-140/+58
| | | | | | | | | | | | | | | | | | | | versions of creation functions. Eventually, the "insertion point" versions of these should just be removed, we do have IRBuilder afterall. Do a massive rewrite of much of pattern match. It is now shorter and less redundant and has several other widgets I will be using in other patches. Among other changes, m_Div is renamed to m_IDiv (since it only matches integer divides) and m_Shift is gone (it used to match all binops!!) and we now have m_LogicalShift for the one client to use. Enhance IRBuilder to have "isExact" arguments to things like CreateUDiv and reduce redundancy within IRbuilder by having these methods chain to each other more instead of duplicating code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125194 91177308-0d34-0410-b5e6-96231b3b80d8
* Add IRBuilder methods for creating an exact udiv, like for exact sdiv.Duncan Sands2011-02-071-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125002 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance vmcore to know that udiv's can be exact, and add a trivialChris Lattner2011-02-061-1/+1
| | | | | | | | | | 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
* FixedNumOperandTraits and VariadicOperandTraits assumed that, given aJay Foad2011-01-111-3/+5
| | | | | | | | | | | "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
* These methods should be "const"; make them so.Duncan Sands2011-01-041-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122809 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the logic behind CastInst::isNoopCast into a separate static function,Dan Gohman2010-05-281-0/+8
| | | | | | | as is done with most other cast opcode predicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105008 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment; vectors are not a special case here.Dan Gohman2010-05-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105006 91177308-0d34-0410-b5e6-96231b3b80d8
* doxygenize some comments, patch by Peter Collingbourne!Chris Lattner2010-02-121-27/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96018 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding missing methods for creating Add, Mul, Neg and Sub with NUW.Duncan Sands2010-02-021-0/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95086 91177308-0d34-0410-b5e6-96231b3b80d8
* add an out-of-line virtual method to CmpInst to give it a home.Chris Lattner2010-01-221-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94161 91177308-0d34-0410-b5e6-96231b3b80d8
* sink twine.h down out of Value.h. It is annoying that you needChris Lattner2009-12-291-1/+2
| | | | | | | to #include Twine.h just to give a twine a default value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92247 91177308-0d34-0410-b5e6-96231b3b80d8
* sink the Instruction::HasMetadata bit into SubclassData.Chris Lattner2009-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92240 91177308-0d34-0410-b5e6-96231b3b80d8
* add a layer of accessors around the Value::SubClassData member, and use Chris Lattner2009-12-291-2/+10
| | | | | | | | | | | | | 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-181-0/+21
| | | | 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-181-0/+4
| | | | | | | 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
* Add CreateNUWAdd and CreateNUWSub to complement the existing CreateNSWAdd andNick Lewycky2009-11-121-0/+42
| | | | | | | CreateNSWSub functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86930 91177308-0d34-0410-b5e6-96231b3b80d8
* rename SimplifyCompare -> SimplifyCmpInst and split it into Chris Lattner2009-11-091-1/+13
| | | | | | | | Simplify[IF]Cmp pieces. Add some predicates to CmpInst to determine whether a predicate is fp or int. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86624 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out redundancy from clone() implementations.Devang Patel2009-10-271-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85327 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove FreeInst.Victor Hernandez2009-10-261-1/+0
| | | | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85176 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove ICmpInst::isSignedPredicate which was a reimplementationNick Lewycky2009-10-251-0/+12
| | | | | | | CmpInst::isSigned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85037 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink isTrueWhenEqual from ICmpInst to CmpInst. Add a matching isFalseWhenEqualNick Lewycky2009-10-251-0/+18
| | | | | | | which is equal to !isTrueWhenEqual for ints but not for floats. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85036 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MallocInst from LLVM Instructions.Victor Hernandez2009-10-171-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84299 91177308-0d34-0410-b5e6-96231b3b80d8
* Round out the API for the new optimization flags.Nick Lewycky2009-09-271-3/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82930 91177308-0d34-0410-b5e6-96231b3b80d8
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-271-2/+2
| | | | | | | update all the callers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82889 91177308-0d34-0410-b5e6-96231b3b80d8
* Add methods for creating NSW subtraction, as already existsDuncan Sands2009-09-261-0/+21
| | | | | | | for addition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82860 91177308-0d34-0410-b5e6-96231b3b80d8
* Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.Dan Gohman2009-09-071-6/+21
| | | | 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-061-3/+3
| | | | | | | 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-061-21/+6
| | | | | | 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-041-6/+21
| | | | | | | | | | | | | | | | | | 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
* Eliminate the unused Context argument on one of the ICmpInst and FCmpInstDan Gohman2009-08-251-1/+1
| | | | | | | constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80049 91177308-0d34-0410-b5e6-96231b3b80d8
* Use covariant return types for Instruction::clone, and eliminateDan Gohman2009-08-251-1/+1
| | | | | | | | the forms of ExtractElementInst and InsertElementInst that are equivalent to clone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80041 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,Dan Gohman2009-08-251-7/+0
| | | | | | | | | | | | | | | | | and introduce a new Instruction::isIdenticalTo which tests for full identity, including the SubclassOptionalData flags. Also, fix the Instruction::clone implementations to preserve the SubclassOptionalData flags. Finally, teach several optimizations how to handle SubclassOptionalData correctly, given these changes. This fixes the counterintuitive behavior of isIdenticalTo not comparing the full value, and clone not returning an identical clone, as well as some subtle bugs that could be caused by these. Thanks to Nick Lewycky for reporting this, and for an initial patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80038 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrapDan Gohman2009-08-201-3/+3
| | | | | | | and hasNoSignedWrap, for consistency with the nuw and nsw properties. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79539 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a bunch more now-unnecessary Context arguments.Dan Gohman2009-08-121-12/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78809 91177308-0d34-0410-b5e6-96231b3b80d8
* Add convenience functions for creating nsw add operators.Dan Gohman2009-08-111-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78707 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVMContext and LLVMContextImpl classes instead of structs.Benjamin Kramer2009-08-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78690 91177308-0d34-0410-b5e6-96231b3b80d8
* Add convenience functions for creating exact sdiv operators, andDan Gohman2009-08-111-0/+22
| | | | | | | use them in CreatePtrDiff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78682 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor some of the constants+context related code out into a separate ↵Owen Anderson2009-08-041-1/+1
| | | | | | | | | header, to make LLVMContextImpl.h not hideous. Also, fix some MSVC compile errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78115 91177308-0d34-0410-b5e6-96231b3b80d8
* Move types back to the 2.5 API.Owen Anderson2009-07-291-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial update to VMCore to use Twines for string arguments.Daniel Dunbar2009-07-251-35/+33
| | | | | | | | - The only meat here is in Value.{h,cpp} the rest is essential 'const std::string &' -> 'const Twine &'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77048 91177308-0d34-0410-b5e6-96231b3b80d8
* Permit the IntPtrTy argument to isEliminableCastPair to be null,Dan Gohman2009-07-211-1/+1
| | | | | | | to help support use when TargetData is not available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76675 91177308-0d34-0410-b5e6-96231b3b80d8
* These don't really need contexts either.Owen Anderson2009-07-131-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75528 91177308-0d34-0410-b5e6-96231b3b80d8
* Move more functionality over to LLVMContext.Owen Anderson2009-07-131-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75497 91177308-0d34-0410-b5e6-96231b3b80d8
* Begin the painful process of tearing apart the rat'ss nest that is ↵Owen Anderson2009-07-131-6/+10
| | | | | | | | | | Constants.cpp and ConstantFold.cpp. This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's the only way I could figure out to make this process vaguely incremental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-10/+6
| | | | | | the [I|F]CmpInst constructors. Who knew!? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75200 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the vicmp and vfcmp instructions. Because we never had a release withNick Lewycky2009-07-081-4/+2
| | | | | | | | these instructions, no autoupgrade or backwards compatibility support is provided. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74991 91177308-0d34-0410-b5e6-96231b3b80d8