summaryrefslogtreecommitdiff
path: root/include/llvm/Bitcode
Commit message (Collapse)AuthorAge
* Re-enables the new vector select in the bitcode reader, by modifying theDan Gohman2008-09-16
| | | | | | | | | | | | | | | | | | | | | | | bitcode reader/writer as follows: - add and use new bitcode FUNC_CODE_INST_VSELECT to handle the llvm select opcode using either i1 or [N x i1] as the selector. - retain old BITCODE FUNC_CODE_INST_SELECT in the bitcode reader to handle select on i1 for backwards compatibility with existing bitcode files. - re-enable the vector-select.ll test program. Also, rename the recently added bitcode opcode FUNC_CODE_INST_VCMP to FUNC_CODE_INST_CMP2 and make the bitcode writer use it to handle fcmp/icmp on scalars or vectors. In the bitcode writer, use FUNC_CODE_INST_CMP for vfcmp/vicmp only. In the bitcode reader, have FUNC_CODE_INST_CMP handle icmp/fcmp returning bool, for backwards compatibility with existing bitcode files. Patch by Preston Gurd! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56233 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the vcmp/fcmp LLVM IR instructions to take vectors as argumentsDan Gohman2008-09-09
| | | | | | | | | | | | | | | and, if so, to return a vector of boolean as a result; Extend the select LLVM IR instruction to allow you to specify a result type which is a vector of boolean, in which case the result will be an element-wise selection instead of choosing one vector or the other; and Update LangRef.html to describe these changes. This patch was contributed by Preston Gurd! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55969 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename some GC classes so that their roll will hopefully be clearer.Gordon Henriksen2008-08-17
| | | | | | | | | | | | | | | | | | In particular, Collector was confusing to implementors. Several thought that this compile-time class was the place to implement their runtime GC heap. Of course, it doesn't even exist at runtime. Specifically, the renames are: Collector -> GCStrategy CollectorMetadata -> GCFunctionInfo CollectorModuleMetadata -> GCModuleInfo CollectorRegistry -> GCRegistry Function::getCollector -> getGC (setGC, hasGC, clearGC) Several accessors and nested types have also been renamed to be consistent. These changes should be obvious. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54899 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold the useful features of alist and alist_node into ilist, andDan Gohman2008-07-28
| | | | | | | | | | | | | | | | | a new ilist_node class, and remove them. Unlike alist_node, ilist_node doesn't attempt to manage storage itself, so it avoids the associated problems, including being opaque in gdb. Adjust the Recycler class so that it doesn't depend on alist_node. Also, change it to use explicit Size and Align parameters, allowing it to work when the largest-sized node doesn't have the greatest alignment requirement. Change MachineInstr's MachineMemOperand list from a pool-backed alist to a std::list for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable first-class aggregates support.Dan Gohman2008-07-23
| | | | | | | | | | | | | Remove the GetResultInst instruction. It is still accepted in LLVM assembly and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove support for return instructions with multiple values. These are auto-upgraded to use InsertValueInst instructions. The IRBuilder still accepts multiple-value returns, and auto-upgrades them to InsertValueInst instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
* InsertValue and ExtractValue constant expressions are alwaysDan Gohman2008-07-21
| | | | | | | | folded. Remove code that handled the case where they aren't folded, and remove bitcode reader/writer support for them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53887 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a little wrapper header that is put around bc files when emittingChris Lattner2008-07-09
| | | | | | | | | | | | | | | | | bc files for modules with a target triple that indicates they are for darwin. The reader unconditionally handles this, and the writer could turn this on for more targets if we care. This change has two benefits for darwin: 1) it allows us to encode the cpu type of the file in an easy to read place that doesn't require decoding the bc file. 2) it works around a bug (IMO) in darwin's AR where it is incapable of handling files that are not a multiple of 8 bytes long. BC files are only guaranteed to be multiples of 4 bytes long. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53275 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"Anton Korobeynikov2008-05-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51687 91177308-0d34-0410-b5e6-96231b3b80d8
* Make structs and arrays first-class types, and add assemblyDan Gohman2008-05-23
| | | | | | | | | | and bitcode support for the extractvalue and insertvalue instructions and constant expressions. Note that this does not yet include CodeGen support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix more -Wshorten-64-to-32 warnings.Evan Cheng2008-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize a local variable.Ted Kremenek2008-05-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50527 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989Nick Lewycky2008-04-25
| | | | | | | r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for Create() calls that take an argument besides theSam Bishop2008-04-07
| | | | | | | deserializer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49350 91177308-0d34-0410-b5e6-96231b3b80d8
* Add member template version of SerializeTrait<T>::Create that also acceptsTed Kremenek2008-04-03
| | | | | | | an optional argument for us by T's Create method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49169 91177308-0d34-0410-b5e6-96231b3b80d8
* change the archive stuff to use MemoryBuffer instead of mappedfile.Chris Lattner2008-04-01
| | | | | | | | MemoryBuffer is higher level and more closely matches the model needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49029 91177308-0d34-0410-b5e6-96231b3b80d8
* remove extraneous #includeChris Lattner2008-04-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49021 91177308-0d34-0410-b5e6-96231b3b80d8
* Make a note of the fact that EmitOwnedPtr() has nothing to do with theSam Bishop2008-03-25
| | | | | | | OwningPtr<> class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48763 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an unwind_to field to basic blocks, making them Users instead of Values.Nick Lewycky2008-03-02
| | | | | | | This is the first checkin for PR1269, the new EH infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47802 91177308-0d34-0410-b5e6-96231b3b80d8
* Read and write getresult.Devang Patel2008-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47471 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-29
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* Added some sectioning comments to Serialize.h.Ted Kremenek2007-12-18
| | | | | | | Added additional serialization functors for use with std::foreach. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45162 91177308-0d34-0410-b5e6-96231b3b80d8
* Modified Deserializer::ReadCStr to allow C-strings to be read into aTed Kremenek2007-12-17
| | | | | | | std::vector<char> starting from any index in the vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45129 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement part of review feedback for address spaces.Christopher Lamb2007-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44933 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement address space attribute for LLVM pointer types. Address spaces are Christopher Lamb2007-12-11
| | | | | | | | | | | | | | | | | | regions of memory that have a target specific relationship, as described in the Embedded C Technical Report. This also implements the 2007-12-11-AddressSpaces test, which demonstrates how address space attributes can be used in LLVM IR. In addition, this patch changes the bitcode signature for stores (in a backwards compatible manner), such that the pointer type, rather than the pointee type, is encoded. This permits type information in the pointer (e.g. address space) to be preserved for stores. LangRef updates are forthcoming. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44858 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding a collector name attribute to Function in the IR. These Gordon Henriksen2007-12-10
| | | | | | | | | | | | | | | | | | | | | methods are new to Function: bool hasCollector() const; const std::string &getCollector() const; void setCollector(const std::string &); void clearCollector(); The assembly representation is as such: define void @f() gc "shadow-stack" { ... The implementation uses an on-the-side table to map Functions to collector names, such that there is no overhead. A StringPool is further used to unique collector names, which are extremely likely to be unique per process. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44769 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "Emitter" functor to allow easy emitting of elements of a containerTed Kremenek2007-12-05
| | | | | | | using std::for_each. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44589 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed subtle bug in Deserializer::JumpTo when jumping when the block-nestingTed Kremenek2007-11-30
| | | | | | | | information matching did not exactly match the underlying stream's scoping information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44470 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed potential bug where CurWord is not zeroed out in JumpToBit.Ted Kremenek2007-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44469 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit keywords.Dan Gohman2007-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44234 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverted patch 44199:Ted Kremenek2007-11-17
| | | | | | | | | | | | | http://llvm.org/viewvc/llvm-project?rev=44199&view=rev This patch completely broke serialization due to an invariant I assumed but did not hold. The assumed invariant was that all pointer IDs emitted by a call to BatchEmitOwnedPtrs would be consecutive. This is only the case if there has been no forward references to an owned pointer (and hence already registered with the Serializer object). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44203 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed implementation of Serialize::EmitDiffPtrID andTed Kremenek2007-11-17
| | | | | | | | | Deserialize::ReadDiffPtrID to read and emit bools instead of unsigned integers. This should result in a nice space optimization once we have "auto-abbreviation" generation in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44200 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented optimization for BatchEmitOwnedPtrs that we only emit one completeTed Kremenek2007-11-17
| | | | | | | | | | | | | | SerializedPtrID, followed by the *differences* in IDs. The big idea is that most IDs will be just be 1 off from the previous (either that or NULL, which we encode as a difference if 0), so this will greatly reduce the encoding space for extra IDs to just 1 bit per pointer. So far this optimization reduces serialization of Carbon.h by only 1%, but we aren't using any abbreviations now in the Bitcode file to properly take advantage of this optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44199 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed serious bug in BatchReadOwnedPtrs where in a chain of calls toTed Kremenek2007-11-15
| | | | | | | | | | | deserialize objects if BatchReadOwnedPtrs was called more than once in the same call chain then the second call would overwrite the SerializedPtrIDs being used by the first call. Solved this problem by making the vector that holds the pointer IDs local to a function call. Now BatchReadOwnedPtrs is reentrant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44152 91177308-0d34-0410-b5e6-96231b3b80d8
* Added two new overloaded versions of BatchEmitOwnedPtrs andTed Kremenek2007-11-14
| | | | | | | BatchReadOwnedPtrs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44105 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed serialization method "Materialize" to "Create". This is an API change.Ted Kremenek2007-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44034 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed bug with inconsistent serialization/deserialization in matchingTed Kremenek2007-11-13
| | | | | | | calls to BatchEmitOwnedPtrs and BatchReadOwnedPtrs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44032 91177308-0d34-0410-b5e6-96231b3b80d8
* Added versions of ReadPtr that takes an explicit SerializedPtrID. This allowsTed Kremenek2007-11-12
| | | | | | | | | | | | | clients of the Deserializer to read the pointer ID before they are ready to deserialize the object (which can mean registering a pointer reference with the backpatcher). Changed some methods that took an argument "SerializedPtrID" to "const SerializedPtrID&" (pass-by-reference). This is to accommodate a future revision of SerializedPtrID where it may be much fatter than an unsigned integer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44021 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a bug introduced by my last patch. Now we properly clear out the ↵Ted Kremenek2007-11-10
| | | | | | | | | BatchIDVec vector before reusing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43984 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed hack in BatchReadOwnedPtrs to no longer use the array of pointers ↵Ted Kremenek2007-11-10
| | | | | | | | | | | passed in for deserialization as a temporary location for storing serialized pointer identifiers. The definition of SerializedPtrID will likely change significantly in the future, and the current implementation caused compilation errors on some 64-bit machines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43983 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "random access" to the Deserializer to allow a client to jump to anyTed Kremenek2007-11-10
| | | | | | | | | serialized block in the bitstream, including a block in an entirely different nesting than the current block. This is useful for deserializing objects from a bitstream in an order different from the order that they were serialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43973 91177308-0d34-0410-b5e6-96231b3b80d8
* Made Deserializer a friend class of BitstreamReader.Ted Kremenek2007-11-10
| | | | | | | | | Moved some of the logic in BitstreamReader::ExitBlock into a utility function BitstreamReader::PopBlockScope. The latter is a private method. It will also be called by Deserializer to manipulate the current "block scope." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43972 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated Deserializer class to provide more information about the currentTed Kremenek2007-11-09
| | | | | | | | | | block that is being visited in the bitstream. The client can also now skip blocks before reading them, and query the current abbreviation number as seen from the perspective of the Deserializer. This allows the client to be more interactive in the deserialization process (if they so choose). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43916 91177308-0d34-0410-b5e6-96231b3b80d8
* Added typedef "SerializedPtrID" to represent the pointer handle written to diskTed Kremenek2007-11-08
| | | | | | | | | | | | instead of just using "unsigned". This gives us more flexibility in changing the definition of the handle later, and is more self-documenting. Added tracking of block stack in the Deserializer. Now clients can query if they are still within a block using the methods GetCurrentBlockLocation() and FinishedBlock(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43903 91177308-0d34-0410-b5e6-96231b3b80d8
* Revised BatchEmitOwnedPtrs to work better with constant pointers.Ted Kremenek2007-11-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43861 91177308-0d34-0410-b5e6-96231b3b80d8
* Revised implementation of BatchReadOwnedPtrs() that deserializes anTed Kremenek2007-11-08
| | | | | | | | | | array of pointers to not allocate a second array to contain the pointer ids. Fixed bug in the same member function where deserialized pointers were not being registered with the backpatcher. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43855 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed bug where we did not properly serialize owned objects due to a missingTed Kremenek2007-11-07
| | | | | | | dereference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43853 91177308-0d34-0410-b5e6-96231b3b80d8
* Added version of BatchEmitOwnedPtrs and BatchReadOwnedPtrs that emits/readsTed Kremenek2007-11-07
| | | | | | | an array of pointers of the same type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43852 91177308-0d34-0410-b5e6-96231b3b80d8
* Added methods to batch emit and deserialize owned pointers. This allowsTed Kremenek2007-11-07
| | | | | | | | to group the pointer IDs together in the bitstream before their referenced contents (which will lend itself to more efficient encoding). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43845 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented serialization of signed integers.Ted Kremenek2007-11-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43828 91177308-0d34-0410-b5e6-96231b3b80d8
* Added special version of ReadPtr() that returns a deserialized pointerTed Kremenek2007-11-07
| | | | | | | | by value. This version prohibits backpatching of pointers, so it useful when a pointee is always known to be deserialized beforehand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43799 91177308-0d34-0410-b5e6-96231b3b80d8