summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* switch to use the new api for structtypes.Chris Lattner2011-08-121-1/+1
| | | | llvm-svn: 137480
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-2/+2
| | | | llvm-svn: 135375
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-86/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert name change from r132533. Lower case naming was intended per style ↵Chad Rosier2011-06-031-2/+2
| | | | | | guidelines. llvm-svn: 132555
* Whitespace and other cleanup. Functionallity unchanged.Chad Rosier2011-06-031-3/+2
| | | | llvm-svn: 132533
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* Fix or remove code which seemed to think that the operand of a ConstantJay Foad2011-04-111-1/+1
| | | | | | was always a User. llvm-svn: 129272
* Do a topological sort of the types before writing them out.Rafael Espindola2011-04-061-26/+68
| | | | | | This takes the linking of libxul on linux from 6m54.931s to 5m39.840s. llvm-svn: 129009
* Clear FunctionLocalMDs in purgeFunction along with the rest of theDan Gohman2010-08-251-1/+1
| | | | | | function-specific state. llvm-svn: 112058
* Fix whitespace.Dan Gohman2010-08-251-1/+1
| | | | llvm-svn: 112056
* Eliminate an unnecessary cast.Dan Gohman2010-08-251-1/+1
| | | | llvm-svn: 112055
* Add braces to fix dangling else.Dan Gohman2010-08-241-2/+2
| | | | llvm-svn: 111896
* Extend function-local metadata to be usable as attachments.Dan Gohman2010-08-241-20/+77
| | | | llvm-svn: 111895
* When we know we have an MDValue or MDString, call EnumerateMetadataDan Gohman2010-08-241-1/+1
| | | | | | directly instead of going through EnumerateValue. llvm-svn: 111894
* Simplify this code. NamedMDNode operands are MDNodes.Dan Gohman2010-08-241-2/+1
| | | | llvm-svn: 111892
* Make NamedMDNode not be a subclass of Value, and simplify the interfaceDan Gohman2010-07-211-22/+7
| | | | | | for creating and populating NamedMDNodes. llvm-svn: 109061
* Fix whitespace.Dan Gohman2010-07-161-2/+2
| | | | llvm-svn: 108569
* Tidy.Bob Wilson2010-06-191-1/+1
| | | | llvm-svn: 106383
* Speedup bitcode writer. Do not walk all values for all functions to emit ↵Devang Patel2010-06-021-4/+7
| | | | | | function local metadata. In one testcase, probably worst case scenario, the 70x speed up is seen. llvm-svn: 105360
* Add special case bitcode support for DebugLoc. This avoidsChris Lattner2010-04-031-1/+8
| | | | | | | | | | | | having the bitcode writer materialize mdnodes for all the debug location tuples when writing out the bc file and stores the information in a more compact form. For example, the -O0 -g bc file for combine.c in 176.gcc shrinks from 739392 to 512096 bytes. This concludes my planned short-term debug info work. llvm-svn: 100261
* Make the side-numbering of instructions used by metadata (which is needed toNick Lewycky2010-02-251-2/+1
| | | | | | | | | keep track of instructions that return void) per-function. This fixes PR5278. This breaks backwards compatibility with the metadata format. That's okay because we haven't released the metadata bitcode yet. llvm-svn: 97132
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-1/+1
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Function-local metadata whose operands had been optimized to no longer refer ↵Victor Hernandez2010-02-061-2/+2
| | | | | | to function-local IR were not getting written by BitcodeWriter; solution is for these metadata to be enumerated just like global metadata. llvm-svn: 95467
* Fix (and test) function-local metadata that occurs before the instruction ↵Victor Hernandez2010-02-041-4/+8
| | | | | | that it refers to; fix is to not enumerate operands of function-local metadata until after all instructions have been enumerated llvm-svn: 95269
* Respect operator precedence (and silence a gcc 4.3 warning).Benjamin Kramer2010-01-231-1/+1
| | | | llvm-svn: 94304
* Remove MetadataBase class because it is not adding significant value.Devang Patel2010-01-221-4/+5
| | | | llvm-svn: 94243
* Simplify code that chooses when to enumerate function-local metadata operandsVictor Hernandez2010-01-141-26/+28
| | | | llvm-svn: 93446
* Clean up unnecessary return and bracketsVictor Hernandez2010-01-141-3/+1
| | | | llvm-svn: 93401
* Enumerate function-local metadata (and its types and operands) only during ↵Victor Hernandez2010-01-131-17/+31
| | | | | | function-incorporation, global metadata continues to be enumerated during creation of ValueEnumerator llvm-svn: 93338
* NamedMDNode is never used so there is no need to enumerate it here.Devang Patel2010-01-091-1/+1
| | | | llvm-svn: 93039
* Derive NamedMDNode from Value.Devang Patel2010-01-091-10/+22
| | | | llvm-svn: 93032
* Use separate namespace for named metadata.Devang Patel2010-01-071-2/+11
| | | | llvm-svn: 92931
* Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}Devang Patel2010-01-051-1/+2
| | | | llvm-svn: 92783
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-1/+1
| | | | | | dereference the type pointer. llvm-svn: 92726
* rename "elements" of metadata to "operands". "Elements" areChris Lattner2009-12-311-6/+6
| | | | | | | things that occur in types. "operands" are things that occur in values. llvm-svn: 92322
* tidyChris Lattner2009-12-311-3/+4
| | | | llvm-svn: 92320
* This is a major cleanup of the instruction metadata interfaces thatChris Lattner2009-12-281-9/+4
| | | | | | | | | | | | | | | | | | | | | | I asked Devang to do back on Sep 27. Instead of going through the MetadataContext class with methods like getMD() and getMDs(), just ask the instruction directly for its metadata with getMetadata() and getAllMetadata(). This includes a variety of other fixes and improvements: previously all Value*'s were bloated because the HasMetadata bit was thrown into value, adding a 9th bit to a byte. Now this is properly sunk down to the Instruction class (the only place where it makes sense) and it will be folded away somewhere soon. This also fixes some confusion in getMDs and its clients about whether the returned list is indexed by the MDID or densely packed. This is now returned sorted and densely packed and the comments make this clear. This introduces a number of fixme's which I'll follow up on. llvm-svn: 92235
* change the strange MetadataContext::getMDs function to expose lessChris Lattner2009-12-281-1/+1
| | | | | | irrelevant internal implementation details to clients. llvm-svn: 92210
* eliminate the elem_* iterator stuff from NamedMDNode.Chris Lattner2009-12-281-5/+2
| | | | llvm-svn: 92208
* Revert 85678/85680. The decision is to stay with the current form of Chris Lattner2009-11-011-5/+3
| | | | | | | indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it for simplicity. llvm-svn: 85699
* Make blockaddress(@func, null) be valid, and make 'deleting a basic Chris Lattner2009-10-311-3/+5
| | | | | | | | | | | | 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). llvm-svn: 85678
* bitcode writer support for blockaddress.Chris Lattner2009-10-281-8/+36
| | | | llvm-svn: 85376
* Type.h doesn't need to #include LLVMContext.hChris Lattner2009-10-271-0/+1
| | | | llvm-svn: 85254
* Fix getMDs() interface such that it does not expose implementation details.Devang Patel2009-10-221-5/+7
| | | | llvm-svn: 84885
* Using TrackingVH instead of WeakVH or WeakMetadataVH.Devang Patel2009-10-221-2/+1
| | | | llvm-svn: 84884
* Do not use SmallVector to store MDNode elements.Devang Patel2009-10-211-4/+3
| | | | llvm-svn: 84784
* s/class Metadata/class MetadataContext/gDevang Patel2009-09-281-3/+3
| | | | llvm-svn: 83019
* Tabs -> spaces, and remove trailing whitespace.Daniel Dunbar2009-09-201-40/+39
| | | | llvm-svn: 82355
* Write and read metadata attachments.Devang Patel2009-09-181-1/+22
| | | | llvm-svn: 82259
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-3/+4
| | | | llvm-svn: 78948
OpenPOWER on IntegriCloud