summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantsContext.h
Commit message (Collapse)AuthorAgeFilesLines
* [ms-inline asm] Enumerate the InlineAsm dialects and rename the nsdialect toChad Rosier2012-09-051-2/+2
| | | | | | inteldialect. llvm-svn: 163231
* [ms-inline asm] Add the inline assembly dialect, AsmDialect, to the InlineAsmChad Rosier2012-09-041-5/+12
| | | | | | class. llvm-svn: 163175
* Switch this code to use hash_combine_range rather than incremental callsChandler Carruth2012-03-071-8/+6
| | | | | | | | | | to hash_combine. One of the interfaces could already do this, and the other can just use a small buffer. This is a much more efficient way to use the hash_combine interface, although I don't have any particular benchmark where this code was hot, so I can't measure much of an impact. It at least doesn't slow anything down. llvm-svn: 152200
* Change ConstantAggrUniqueMap to use Chandler's new hashingJay Foad2012-03-061-36/+9
| | | | | | implementation. Patch by Meador Inge llvm-svn: 152116
* Efficient Constant Uniquing.Talin2012-02-051-38/+161
| | | | llvm-svn: 149848
* smallvectorize and ArrayRef'ize some stuff.Chris Lattner2012-01-261-2/+2
| | | | llvm-svn: 149077
* convert CAZ, UndefValue, and CPN to use DenseMap's again, this time withoutChris Lattner2012-01-231-46/+0
| | | | | | | | using OwningPtr. OwningPtr would barf when the densemap had to reallocate, which doesn't appear to happen on the regression test suite, but obviously happens in real life :) llvm-svn: 148700
* revert r148691 and 148693Chris Lattner2012-01-231-0/+46
| | | | llvm-svn: 148698
* switch UndefValue and ConstantPointerNull over to DenseMap's for uniquing.Chris Lattner2012-01-231-31/+0
| | | | llvm-svn: 148693
* Replace a use of ConstantUniqueMap for CAZ constants with a simple DenseMap.Chris Lattner2012-01-231-15/+0
| | | | | | | Now that the type system rewrite has landed, there is no need for its complexity and std::map'ness. llvm-svn: 148691
* Remove unreachable code. (replace with llvm_unreachable to help GCC where ↵David Blaikie2012-01-171-1/+0
| | | | | | necessary) llvm-svn: 148284
* Unweaken vtables as per ↵David Blaikie2011-12-201-1/+12
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-16/+16
| | | | llvm-svn: 135375
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-138/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. llvm-svn: 134829
* Extend ConstantUniqueMap with a new template parameter ValRefType,Jay Foad2011-06-221-3/+3
| | | | | | | | representing a constant reference to ValType. Normally this is just "const ValType &", but when ValType is a std::vector we want to use ArrayRef as the reference type. llvm-svn: 133611
* PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plusJay Foad2011-04-131-7/+5
| | | | | | related tweaks to ExprMapKeyType. llvm-svn: 129443
* FixedNumOperandTraits and VariadicOperandTraits assumed that, given aJay Foad2011-01-111-10/+20
| | | | | | | | | | | "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. llvm-svn: 123235
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-281-8/+0
| | | | | | being actively maintained, improved, or extended. llvm-svn: 112356
* Fix PR7658, a problem where type refinement can triggerChris Lattner2010-07-171-2/+6
| | | | | | | | 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
* Free all Constants in ~LLVMConstantImpl. We avoid assertion failuresJeffrey Yasskin2010-03-221-2/+2
| | | | | | | | | by dropping all references from all constants that can use other constants before trying to destroy any of them. I also had to free bugpoint's Module in ~BugDriver(). llvm-svn: 99160
* Memoize InlineAsms into the LLVMContext and delete them on shutdown.Jeffrey Yasskin2010-03-211-0/+51
| | | | | | Fixes PR803. llvm-svn: 99143
* Add support for a union type in LLVM IR. Patch by Talin!Chris Lattner2010-02-121-0/+15
| | | | llvm-svn: 96011
* Fix a build error and change errs() to dbgs().David Greene2010-01-051-1/+2
| | | | llvm-svn: 92669
* Change errs() to dbgs().David Greene2010-01-051-1/+0
| | | | llvm-svn: 92659
* remove a bunch of locking from LLVMContextImpl. Since only one threadChris Lattner2009-11-011-14/+0
| | | | | | | can be banging on a context at a time, this isn't needed. Owen, please review. llvm-svn: 85728
* Rename lib/VMCore/ConstantsContext.h:ValueMap<> to ConstantUniqueMap<> to avoidJeffrey Yasskin2009-10-271-8/+8
| | | | | | colliding with llvm/ADT/ValueMap.h:ValueMap<>. llvm-svn: 85344
* When a constant's type is refined, update the constant in placeDan Gohman2009-09-151-165/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | instead of cloning and RAUWing it. - Make AbstractTypeUser a friend of Value so that it can offer its subclasses a way to update a Value's type in place. This is better than a universally visible setType method on Value, and it's sufficient for the immediate need. - Eliminate the constant "convert" functions. This eliminates a lot of logic duplication, and fixes a complicated bug where a constant can't actually be cloned during the type refinement process because some of the types that its folder needs are half-destroyed, being in the middle of refinement themselves. - Move the getValType functions from being static overloaded functions in Constants.cpp to be members of class template specializations in ConstantsContext.h. This means that the code ends up getting instantiated twice, however it also makes it possible to eliminate all "convert" functions, so it's not a big net code size increase. And if desired, the duplicate instantiations could be eliminated with some reorganization. llvm-svn: 81861
* Preserve the inbounds flag, so that the constant folder doesn'tDan Gohman2009-09-121-2/+5
| | | | | | recompute it. llvm-svn: 81634
* Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.Dan Gohman2009-09-071-18/+31
| | | | llvm-svn: 81172
* Public and private corrections, warned about by icc (#304).Duncan Sands2009-09-061-10/+10
| | | | | | Patch by Erick Tryzelaar. llvm-svn: 81107
* Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", thisDaniel Dunbar2009-09-061-31/+18
| | | | | | breaks MiniSAT on x86_64. llvm-svn: 81098
* Include optional subclass flags, such as inbounds, nsw, etc., in theDan Gohman2009-09-041-18/+31
| | | | | | | | | | | | | | | | | 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. llvm-svn: 80998
* Now Bitcode reader bug is fixed. Reapply 80839.Devang Patel2009-09-031-19/+12
| | | | | | | | 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. llvm-svn: 80868
* Revert 80839 for now. It causes test failures.Devang Patel2009-09-021-12/+19
| | | | llvm-svn: 80841
* Use CallbackVH, instead of WeakVH, to hold MDNode elements. Devang Patel2009-09-021-19/+12
| | | | | | | Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. llvm-svn: 80839
* Free the constants that have no uses in ~LLVMContext.Torok Edwin2009-08-311-0/+8
| | | | | | | | | | | This fixes leaks from LLVMContext in multithreaded apps. Since constants are only deleted if they have no uses, it is safe to not delete a Module on shutdown, as many single-threaded tools do. Multithreaded apps should however delete the Module before destroying the Context to ensure that there are no leaks (assuming they use a different context for each thread). llvm-svn: 80590
* remove some DOUTsChris Lattner2009-08-231-1/+2
| | | | llvm-svn: 79821
* Use standard LLVM-style headers.Owen Anderson2009-08-231-1/+1
| | | | llvm-svn: 79817
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-1/+1
| | | | llvm-svn: 78948
* Remove dead metadata.Devang Patel2009-08-111-0/+1
| | | | llvm-svn: 78651
* Rename ConvertType to ConvertConstant to avoid a name conflict on llvm-gcc.Daniel Dunbar2009-08-101-9/+9
| | | | llvm-svn: 78596
* g++ 4.0 doesn't have std::vector::data.Benjamin Kramer2009-08-101-1/+1
| | | | llvm-svn: 78579
* Change the MDNode uniquing to a ValueMap, at Devang's request.Owen Anderson2009-08-101-12/+19
| | | | llvm-svn: 78577
* It helps if I remember to actually add the file...Owen Anderson2009-08-041-0/+774
llvm-svn: 78116
OpenPOWER on IntegriCloud