summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r98656, its breaking all over the place.Daniel Dunbar2010-03-161-7/+0
| | | | llvm-svn: 98662
* improve support for uniontype and ConstantUnion, patch by Tim Northover!Chris Lattner2010-03-161-0/+7
| | | | llvm-svn: 98656
* Make the side-numbering of instructions used by metadata (which is needed toNick Lewycky2010-02-251-0/+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-6/+6
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-7/+7
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Add support for a union type in LLVM IR. Patch by Talin!Chris Lattner2010-02-121-0/+7
| | | | llvm-svn: 96011
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-271-70/+63
| | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. llvm-svn: 94686
* Fix the bitcode reader to deserialize nuw/nsw/etc. bits properly in the caseDan Gohman2010-01-251-3/+3
| | | | | | of a forward-reference, which doesn't use an "abbrev" encoding. llvm-svn: 94454
* Fix a crasher trying to fold each element in a comparison between two vectorsNick Lewycky2010-01-211-1/+1
| | | | | | | | | | if one of the vectors didn't have elements (such as undef). Fixes PR 6096. Fix an issue in the constant folder where fcmp (<2 x %ty>, <2 x %ty>) would have <2 x i1> type if constant folding was successful and i1 type if it wasn't. This exposed a related issue in the bitcode reader. llvm-svn: 94069
* Parse function-local metadata inside function blocksVictor Hernandez2010-01-131-0/+3
| | | | llvm-svn: 93337
* s/NextValueNo/NextMDValueNo while processing metadata.Devang Patel2010-01-111-5/+4
| | | | llvm-svn: 93165
* Compute isFunctionLocal in MDNode ctor or via argument in new function ↵Victor Hernandez2010-01-101-1/+7
| | | | | | | | getWhenValsUnresolved(). Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue(). llvm-svn: 93108
* clean up this code, add a fixme.Chris Lattner2010-01-091-7/+7
| | | | llvm-svn: 93042
* NamedMDNode element is either null or MDNode. Otherwise this is a malformed ↵Devang Patel2010-01-091-1/+3
| | | | | | NamedMDNode record. llvm-svn: 93037
* Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}Devang Patel2010-01-051-3/+7
| | | | llvm-svn: 92783
* NamedMDNode is a collection MDNodes.Devang Patel2010-01-051-3/+3
| | | | llvm-svn: 92761
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-2/+2
| | | | | | dereference the type pointer. llvm-svn: 92726
* Final step in the metadata API restructuring: move the Chris Lattner2009-12-291-2/+1
| | | | | | | | getMDKindID/getMDKindNames methods to LLVMContext (and add convenience methods to Module), eliminating MetadataContext. Move the state that it maintains out to LLVMContext. llvm-svn: 92259
* This is a major cleanup of the instruction metadata interfaces thatChris Lattner2009-12-281-3/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* rename getMDKind -> getMDKindID, make it autoinsert if an MD KindChris Lattner2009-12-281-11/+4
| | | | | | | doesn't exist already, eliminate registerMDKind. Tidy up a bunch of random stuff. llvm-svn: 92225
* Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.Victor Hernandez2009-11-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Here is the original commit message: This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments. Update CreateMalloc so that its callers specify the size to allocate: MallocInst-autoupgrade users use non-TargetData-computed allocation sizes. Optimization uses use TargetData to compute the allocation size. Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays. Extend getMallocType() to support malloc calls that have non-bitcast uses. Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly. Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use. Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use. Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes. llvm-svn: 86311
* Revert r86077 because it caused crashes in 179.art and 175.vpr on ARMVictor Hernandez2009-11-061-3/+1
| | | | llvm-svn: 86213
* Update CreateMalloc so that its callers specify the size to allocate:Victor Hernandez2009-11-051-1/+3
| | | | | | | | | | | | | | | | | | MallocInst-autoupgrade users use non-TargetData-computed allocation sizes. Optimization uses use TargetData to compute the allocation size. Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays. Extend getMallocType() to support malloc calls that have non-bitcast uses. Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly. Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use. Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use. Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes. llvm-svn: 86077
* Revert 85678/85680. The decision is to stay with the current form of Chris Lattner2009-11-011-3/+2
| | | | | | | 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-2/+3
| | | | | | | | | | | | 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
* add bitcode reader support for blockaddress. We can now fullyChris Lattner2009-10-281-0/+37
| | | | | | | | | | round trip blockaddress through .ll and .bc files, so add a testcase. There are still a bunch of places in the optimizer and other places that need to be updated to work with these constructs, but at least the basics are in now. llvm-svn: 85377
* rename indbr -> indirectbr to appease the residents of #llvm.Chris Lattner2009-10-281-5/+5
| | | | llvm-svn: 85351
* add enough support for indirect branch for the feature test to passChris Lattner2009-10-271-2/+23
| | | | | | | (assembler,asmprinter, bc reader+writer) and document it. Codegen currently aborts on it. llvm-svn: 85274
* Suppress -Asserts warning.Daniel Dunbar2009-10-251-0/+2
| | | | llvm-svn: 85078
* Auto-upgrade free instructions to calls to the builtin free function.Victor Hernandez2009-10-241-1/+2
| | | | | | | Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. llvm-svn: 84987
* Hide MetadataContext implementation details.Devang Patel2009-10-221-1/+9
| | | | llvm-svn: 84886
* Rename msasm to alignstack per review.Dale Johannesen2009-10-211-2/+2
| | | | llvm-svn: 84795
* Make changes to rev 84292 as requested by Chris Lattner.Victor Hernandez2009-10-211-7/+4
| | | | | | | Most changes are cleanup, but there is 1 correctness fix: I fixed InstCombine so that the icmp is removed only if the malloc call is removed (which requires explicit removal because the Worklist won't DCE any calls since they can have side-effects). llvm-svn: 84772
* Autoupgrade malloc insts to malloc calls.Victor Hernandez2009-10-171-2/+9
| | | | | | | | Update testcases that rely on malloc insts being present. Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step. llvm-svn: 84292
* Add an "msasm" flag to inline asm as suggested in PR 5125.Dale Johannesen2009-10-131-2/+3
| | | | | | | A little ugliness is accepted to keep the binary file format compatible. No functional change yet. llvm-svn: 84020
* Remove unnecessary assert.Devang Patel2009-10-131-3/+0
| | | | llvm-svn: 84004
* strength reduce a ton of type equality tests to check the typeid (ThroughChris Lattner2009-10-051-7/+7
| | | | | | | | the new predicates I added) instead of going through a context and doing a pointer comparison. Besides being cheaper, this allows a smart compiler to turn the if sequence into a switch. llvm-svn: 83297
* Only one custom meadata of each kind can be attached with an instruction.Devang Patel2009-09-291-1/+1
| | | | llvm-svn: 83105
* s/class Metadata/class MetadataContext/gDevang Patel2009-09-281-2/+2
| | | | llvm-svn: 83019
* Do not use global typedef for MDKindID.Devang Patel2009-09-281-2/+2
| | | | llvm-svn: 83016
* Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it ↵Victor Hernandez2009-09-251-9/+2
| | | | | | causes regressions in the nightly tests. llvm-svn: 82784
* Auto-upgrade malloc instructions to malloc calls.Victor Hernandez2009-09-241-2/+9
| | | | | | Reviewed by Devang Patel. llvm-svn: 82694
* Tabs -> spaces, and remove trailing whitespace.Daniel Dunbar2009-09-201-206/+206
| | | | llvm-svn: 82355
* Write and read metadata attachments.Devang Patel2009-09-181-1/+91
| | | | llvm-svn: 82259
* Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.Dan Gohman2009-09-071-22/+34
| | | | llvm-svn: 81172
* Public and private corrections, warned about by icc (#304).Duncan Sands2009-09-061-1/+1
| | | | | | Patch by Erick Tryzelaar. llvm-svn: 81107
* Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", thisDaniel Dunbar2009-09-061-34/+22
| | | | | | breaks MiniSAT on x86_64. llvm-svn: 81098
* Include optional subclass flags, such as inbounds, nsw, etc., in theDan Gohman2009-09-041-22/+34
| | | | | | | | | | | | | | | | | 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
* Add new value for given index in MDValuePtrs.Devang Patel2009-09-031-0/+3
| | | | llvm-svn: 80867
* Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.Sandeep Patel2009-09-021-3/+5
| | | | llvm-svn: 80773
OpenPOWER on IntegriCloud