summaryrefslogtreecommitdiff
path: root/lib/VMCore/LLVMContextImpl.h
Commit message (Collapse)AuthorAge
* Rename VMCore directory to IR.Chandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | Aside from moving the actual files, this patch only updates the build system and the source file comments under lib/... that are relevant. I'll be updating other docs and other files in smaller subsequnet commits. While I've tried to test this, but it is entirely possible that there will still be some build system fallout. Also, note that I've not changed the library name itself: libLLVMCore.a is still the library name. I'd be interested in others' opinions about whether we should rename this as well (I think we should, just not sure what it might break) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171359 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename LLVMContext diagnostic handler types and functions.Bob Wilson2012-12-25
| | | | | | | | | These are now generally used for all diagnostics from the backend, not just for inline assembly, so this drops the "InlineAsm" from the names. No functional change. (I've left aliases for the old names but only for long enough to let me switch over clang to use the new ones.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171047 91177308-0d34-0410-b5e6-96231b3b80d8
* s/AttributesImpl/AttributeImpl/g This is going to apply to Attribute, not ↵Bill Wendling2012-12-20
| | | | | | Attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170631 91177308-0d34-0410-b5e6-96231b3b80d8
* s/AttributeListImpl/AttributeSetImpl/g to match the namechange of AttributeList.Bill Wendling2012-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170600 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth2012-12-04
| | | | | | | | | | missed in the first pass because the script didn't yet handle include guards. Note that the script is now able to handle all of these headers without manual edits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169224 91177308-0d34-0410-b5e6-96231b3b80d8
* Move semantics are great, don't destroy the optimization opportunity with ↵Benjamin Kramer2012-11-25
| | | | | | | | trivial copy ctors. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168561 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the AttrListPtr object a part of the LLVMContext.Bill Wendling2012-11-20
| | | | | | | | | | When code deletes the context, the AttributeImpls that the AttrListPtr points to are now invalid. Therefore, instead of keeping a separate managed static for the AttrListPtrs that's reference counted, move it into the LLVMContext and delete it when deleting the AttributeImpls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168354 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the AttributesImpl header file into the VMCore directory so that it can ↵Bill Wendling2012-10-15
| | | | | | be opaque. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165920 91177308-0d34-0410-b5e6-96231b3b80d8
* Begin the transition to using the AttributesImpl object for the Attributes ivar.Bill Wendling2012-10-08
| | | | | | | | | | | | Start using the AttributesImpl object to hold the value of the attributes. All queries go through the interfaces now. This has one unfortunate consequence. I needed to move the AttributesImpl.h file into include/llvm. But this is only temporary! Otherwise, the changes needed to support this would be too large. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165433 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial commit for the AttributesImpl class.Bill Wendling2012-09-26
| | | | | | | | | This opaque class will contain all of the attributes. All attribute queries will go through this object. This object will also be uniqued in the LLVMContext. Currently not used, so no implementation change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164722 91177308-0d34-0410-b5e6-96231b3b80d8
* Cache the hash value of the operands in the MDNode.Benjamin Kramer2012-04-11
| | | | | | | | | | | | | | | | | | FoldingSet is implemented as a chained hash table. When there is a hash collision during insertion, which is common as we fill the table until a load factor of 2.0 is hit, we walk the chained elements, comparing every operand with the new element's operands. This can be very expensive if the MDNode has many operands. We sacrifice a word of space in MDNode to cache the full hash value, reducing compares on collision to a minimum. MDNode grows from 28 to 32 bytes + operands on x86. On x86_64 the new bits fit nicely into existing padding, not growing the struct at all. The actual speedup depends a lot on the test case and is typically between 1% and 2% for C++ code with clang -c -O0 -g. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154497 91177308-0d34-0410-b5e6-96231b3b80d8
* The MDString class stored a StringRef to the string which was already in aBill Wendling2012-04-10
| | | | | | | | | | | | | | StringMap. This was redundant and unnecessarily bloated the MDString class. Because the MDString class is a "Value" and will never have a "name", and because the Name field in the Value class is a pointer to a StringMap entry, we repurpose the Name field for an MDString. It stores the StringMap entry in the Name field, and uses the normal methods to get the string (name) back. PR12474 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154429 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the hashing functions on APInt and APFloat with overloads of theChandler Carruth2012-03-04
| | | | | | | | | | | | | | new hash_value infrastructure, and replace their implementations using hash_combine. This removes a complete copy of Jenkin's lookup3 hash function (which is both significantly slower and lower quality than the one implemented in hash_combine) along with a somewhat scary xor-only hash function. Now that APInt and APFloat can be passed directly to hash_combine, simplify the rest of the LLVMContextImpl hashing to use the new infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152004 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite LLVM's generalized support library for hashing to follow the APIChandler Carruth2012-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the proposed standard hashing interfaces (N3333), and to use a modified and tuned version of the CityHash algorithm. Some of the highlights of this change: -- Significantly higher quality hashing algorithm with very well distributed results, and extremely few collisions. Should be close to a checksum for up to 64-bit keys. Very little clustering or clumping of hash codes, to better distribute load on probed hash tables. -- Built-in support for reserved values. -- Simplified API that composes cleanly with other C++ idioms and APIs. -- Better scaling performance as keys grow. This is the fastest algorithm I've found and measured for moderately sized keys (such as show up in some of the uniquing and folding use cases) -- Support for enabling per-execution seeds to prevent table ordering or other artifacts of hashing algorithms to impact the output of LLVM. The seeding would make each run different and highlight these problems during bootstrap. This implementation was tested extensively using the SMHasher test suite, and pased with flying colors, doing better than the original CityHash algorithm even. I've included a unittest, although it is somewhat minimal at the moment. I've also added (or refactored into the proper location) type traits necessary to implement this, and converted users of GeneralHash over. My only immediate concerns with this implementation is the performance of hashing small keys. I've already started working to improve this, and will continue to do so. Currently, the only algorithms faster produce lower quality results, but it is likely there is a better compromise than the current one. Many thanks to Jeffrey Yasskin who did most of the work on the N3333 paper, pair-programmed some of this code, and reviewed much of it. Many thanks also go to Geoff Pike Pike and Jyrki Alakuijala, the original authors of CityHash on which this is heavily based, and Austin Appleby who created MurmurHash and the SMHasher test suite. Also thanks to Nadav, Tobias, Howard, Jay, Nick, Ahmed, and Duncan for all of the review comments! If there are further comments or concerns, please let me know and I'll jump on 'em. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151822 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r151049 now that GeneralHash is fixed.Jay Foad2012-02-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151248 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r151049 cos it broke the buildbots.Jay Foad2012-02-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151052 91177308-0d34-0410-b5e6-96231b3b80d8
* PR1210: make uniquing of struct and function types more efficient byJay Foad2012-02-21
| | | | | | | | | | using a DenseMap and Talin's new GeneralHash, avoiding the need for a temporary std::vector on every lookup. Patch by Meador Inge! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151049 91177308-0d34-0410-b5e6-96231b3b80d8
* Efficient Constant Uniquing.Talin2012-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149848 91177308-0d34-0410-b5e6-96231b3b80d8
* start the implementation of a new ConstantDataVector and ConstantDataArrayChris Lattner2012-01-23
| | | | | | | | classes, per PR1324. Not all of their helper functions are implemented, nothing creates them, and the rest of the compiler doesn't handle them yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148741 91177308-0d34-0410-b5e6-96231b3b80d8
* convert CAZ, UndefValue, and CPN to use DenseMap's again, this time withoutChris Lattner2012-01-23
| | | | | | | | | 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 :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148700 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r148691 and 148693Chris Lattner2012-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148698 91177308-0d34-0410-b5e6-96231b3b80d8
* switch UndefValue and ConstantPointerNull over to DenseMap's for uniquing.Chris Lattner2012-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148693 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace a use of ConstantUniqueMap for CAZ constants with a simple DenseMap.Chris Lattner2012-01-23
| | | | | | | | Now that the type system rewrite has landed, there is no need for its complexity and std::map'ness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148691 91177308-0d34-0410-b5e6-96231b3b80d8
* The powers that be have decided that LLVM IR should now support 16-bitDan Gohman2011-12-17
| | | | | | | | | "half precision" floating-point with a first-class type. This patch adds basic IR support (but not codegen support). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146786 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* bump pointer allocate LLVM IR types, since they are never deallocated.Chris Lattner2011-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135248 91177308-0d34-0410-b5e6-96231b3b80d8
* stop leaking all named struct types with an empty name. ThanksChris Lattner2011-07-13
| | | | | | | | to Benjamin Kramer for steering me in the right direction here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135031 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend ConstantUniqueMap with a new template parameter ValRefType,Jay Foad2011-06-22
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133611 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the Type::getDescription() method, using "<<" instead. This Chris Lattner2011-06-18
| | | | | | | removes some gunk from LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133360 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-15
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
* now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate theChris Lattner2010-11-17
| | | | | | | | | cookie argument to the SourceMgr diagnostic stuff. This cleanly separates LLVMContext's inlineasm handler from the sourcemgr error handling definition, increasing type safety and cleaning things up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119486 91177308-0d34-0410-b5e6-96231b3b80d8
* Add X86 MMX type to bitcode and Type.Dale Johannesen2010-09-10
| | | | | | | | | (The Ada bindings probably need it too, but all the obvious places to change say "do not edit this file".) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113618 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify the ownership model of LLVMContext and Module. Namely, contexts ownOwen Anderson2010-09-08
| | | | | | | | modules are instantiated in them. If the context is deleted, all of its owned modules are also deleted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113374 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
* give LLVMContext an inline asm diagnostic hook member.Chris Lattner2010-04-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100506 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new "NewDebugLoc" class which will eventually replace DebugLoc,Chris Lattner2010-04-01
| | | | | | | | | | | | | | and will replace the 'DbgInfo' member in Instruction. The benefit of NewDebugLoc is that it is compact (8 bytes vs 12/24 bytes for the DbgInfo member in Instruction on a 32/64 bit system), it means that we will end up not having to allocate MDNodes to represent the "DILocations" in common cases of -O0 -g, and it is much more efficient to get things out of than the MDNode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100072 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-add the Metadata.h include to LLVMContextImpl.h so that MDNode is completeJeffrey Yasskin2010-03-21
| | | | | | | | where FoldingSet<MDNode> is instantiated. Clang and MSVC complain; gcc doesn't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99147 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the LLVMContextImpl implementation into a .cpp file.Jeffrey Yasskin2010-03-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99146 91177308-0d34-0410-b5e6-96231b3b80d8
* Memoize InlineAsms into the LLVMContext and delete them on shutdown.Jeffrey Yasskin2010-03-21
| | | | | | | Fixes PR803. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99143 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete MDNodes when LLVMContext is destroyed. Previous attempts: r97918, ↵Jeffrey Yasskin2010-03-13
| | | | | | | | | | | | r97788. Tested: clang debug bootstrap, llvm-gcc bootstrap, `make check-lit` after configuring with --with-llvmgccdir (and this did run the FrontendC* tests this time) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98410 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll back r97918 again. Just configuring against llvm-gcc wasn't enough to runJeffrey Yasskin2010-03-07
| | | | | | | the FrontendC* tests. :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97921 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r97788 to free MDNodes when the LLVMContext is destroyed. ItJeffrey Yasskin2010-03-07
| | | | | | | bootstraps llvm-gcc this time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97918 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.Jeffrey Yasskin2010-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97792 91177308-0d34-0410-b5e6-96231b3b80d8
* Free MDNodes when the LLVMContext is destroyed. Leak found by Valgrind.Jeffrey Yasskin2010-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97788 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop leaking MDStrings.Jeffrey Yasskin2010-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97763 91177308-0d34-0410-b5e6-96231b3b80d8
* Destroy MDNodes gracefully while deleting llvm context.Devang Patel2010-02-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96609 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
* revert 95903.Devang Patel2010-02-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95918 91177308-0d34-0410-b5e6-96231b3b80d8
* Destroy MDNodes while destructing llvm context.Devang Patel2010-02-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95903 91177308-0d34-0410-b5e6-96231b3b80d8