summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Verifier.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename VMCore directory to IR.Chandler Carruth2013-01-021-2015/+0
| | | | | | | | | | | | | | | | | | 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) llvm-svn: 171359
* Inline hasFunctionOnlyAttrs into its only use.Bill Wendling2012-12-191-1/+19
| | | | llvm-svn: 170518
* Inline the only use of the hasParameterOnlyAttrs method.Bill Wendling2012-12-191-1/+4
| | | | llvm-svn: 170517
* Inline the 'hasIncompatibleWithVarArgsAttrs' method into its only uses. And ↵Bill Wendling2012-12-191-1/+1
| | | | | | some minor comment reformatting. llvm-svn: 170516
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-52/+52
| | | | | | single attribute in the future. llvm-svn: 170502
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-071-5/+5
| | | | | | in the near future. llvm-svn: 169651
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-10/+10
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Move the InstVisitor utility into VMCore where it belongs. It heavilyChandler Carruth2012-11-301-1/+1
| | | | | | | | | | | | depends on the IR infrastructure, there is no sense in it being off in Support land. This is in preparation to start working to expand InstVisitor into more special-purpose visitors that are still generic and can be re-used across different passes. The expansion will go into the Analylis tree though as nothing in VMCore needs it. llvm-svn: 168972
* Relax the restrictions on vector of pointer types, and vector getelementptr.Duncan Sands2012-11-131-22/+19
| | | | | | | | | | | | | | | Previously in a vector of pointers, the pointer couldn't be any pointer type, it had to be a pointer to an integer or floating point type. This is a hassle for dragonegg because the GCC vectorizer happily produces vectors of pointers where the pointer is a pointer to a struct or whatever. Vector getelementptr was restricted to just one index, but now that vectors of pointers can have any pointer type it is more natural to allow arbitrary vector getelementptrs. There is however the issue of struct GEPs, where if each lane chose different struct fields then from that point on each lane will be working down into unrelated types. This seems like too much pain for too little gain, so when you have a vector struct index all the elements are required to be the same. llvm-svn: 167828
* Back out r166591, not sure why this made it through since I cancelled the ↵Micah Villmow2012-10-241-2/+1
| | | | | | command. Bleh, sorry about this! llvm-svn: 166596
* Delete a directory that wasn't supposed to be checked in yet.Micah Villmow2012-10-241-1/+2
| | | | llvm-svn: 166591
* Special calling conventions for Intel OpenCL built-in library.Elena Demikhovsky2012-10-241-0/+1
| | | | llvm-svn: 166566
* Revert r166157 because some tests fail...Bill Wendling2012-10-171-3/+1
| | | | llvm-svn: 166159
* Check that the operand of the GEP is not the GEP itself. This occurred ↵Bill Wendling2012-10-171-1/+3
| | | | | | during an LTO build of LLVM. llvm-svn: 166157
* Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-151-2/+2
| | | | | | own class named AttrBuilder. No functionality change. llvm-svn: 165960
* Attributes RewriteBill Wendling2012-10-151-1/+1
| | | | | | | | | | Convert the internal representation of the Attributes class into a pointer to an opaque object that's uniqued by and stored in the LLVMContext object. The Attributes class then becomes a thin wrapper around this opaque object. Eventually, the internal representation will be expanded to include attributes that represent code generation options, etc. llvm-svn: 165917
* Remove the bitwise AND operators from the Attributes class. Replace it with ↵Bill Wendling2012-10-141-3/+4
| | | | | | the equivalent from the builder class. llvm-svn: 165896
* Inline the checks for mutually exclusive attributes since they're used in ↵Bill Wendling2012-10-091-12/+56
| | | | | | only one module. llvm-svn: 165539
* Move the 'FunctionOnly' attributes thingy inside of the Attributes class.Bill Wendling2012-10-091-8/+10
| | | | llvm-svn: 165530
* Move the 'ParameterOnly' variable inside of the Attributes class and make it ↵Bill Wendling2012-10-091-15/+12
| | | | | | a method. llvm-svn: 165497
* Remove the now dead VarArgsIncompatible variable.Bill Wendling2012-10-091-3/+2
| | | | llvm-svn: 165496
* Create enums for the different attributes.Bill Wendling2012-10-091-2/+2
| | | | | | | We use the enums to query whether an Attributes object has that attribute. The opaque layer is responsible for knowing where that specific attribute is stored. llvm-svn: 165488
* Use method to query for attributes.Bill Wendling2012-10-051-1/+1
| | | | llvm-svn: 165304
* Move Attribute::typeIncompatible inside of the Attributes class.Bill Wendling2012-09-251-1/+1
| | | | llvm-svn: 164629
* Make the 'getAsString' function a method of the Attributes class.Bill Wendling2012-09-201-9/+9
| | | | llvm-svn: 164305
* Convert some attribute existence queries over to use the predicate methods.Bill Wendling2012-09-191-2/+2
| | | | llvm-svn: 164268
* Make atomic load and store of pointers work. Tighten verification of atomic ↵Eli Friedman2012-08-171-0/+32
| | | | | | | | | operations so other unexpected operations don't slip through. Based on patch by Logan Chien. PR11786/PR13186. llvm-svn: 162146
* Change the `linker_private_weak_def_auto' linkage to `linkonce_odr_auto_hide' toBill Wendling2012-08-171-2/+2
| | | | | | | | | | | | | | | | | | | | make it more consistent with its intended semantics. The `linker_private_weak_def_auto' linkage type was meant to automatically hide globals which never had their addresses taken. It has nothing to do with the `linker_private' linkage type, which outputs the symbols with a `l' (ell) prefix among other things. The intended semantic is more like the `linkonce_odr' linkage type. Change the name of the linkage type to `linkonce_odr_auto_hide'. And therefore changing the semantics so that it produces the correct output for the linker. Note: The old linkage name `linker_private_weak_def_auto' will still parse but is not a synonym for `linkonce_odr_auto_hide'. This should be removed in 4.0. <rdar://problem/11754934> llvm-svn: 162114
* Assert that dominates is not given a multiple edge. Finding out if we haveRafael Espindola2012-08-171-0/+7
| | | | | | | | | | | | | multiple edges between two blocks is linear. If the caller is iterating all edges leaving a BB that would be a square time algorithm. It is more efficient to have the callers handle that case. Currently the only callers are: * GVN: already avoids the multiple edge case. * Verifier: could only hit this assert when looking at an invalid invoke. Since it already rejects the invoke, just avoid computing the dominance for it. llvm-svn: 162113
* Fix a typo that led to a failure to correctly verify bitcast instructions.Nick Lewycky2012-08-151-1/+1
| | | | | | Patch by Stephen Hines! llvm-svn: 161921
* The normal edge of an invoke is not allowed to branch to a block with aEli Friedman2012-08-101-1/+1
| | | | | | landingpad. Enforce it in the verifier, and fix the regression tests to match. llvm-svn: 161697
* make the verifier accept @llvm.donothing as the only intrinsic that can be ↵Nuno Lopes2012-06-281-2/+4
| | | | | | | | invoked While at it, merge 2 tests and FileCheckize them llvm-svn: 159388
* improve optimization of invoke instructions:Nuno Lopes2012-06-251-1/+2
| | | | | | | | - simplifycfg: invoke undef/null -> unreachable - instcombine: invoke new -> invoke expect(0, 0) (an arbitrary NOOP intrinsic; only done if the allocated memory is unused, of course) - verifier: allow invoke of intrinsics (to make the previous step work) llvm-svn: 159146
* revert r158660, since Chris has some issues with this patch (namely using ↵Nuno Lopes2012-06-181-33/+0
| | | | | | | | | | code to reprent information only used by the compiler) Original commit msg: add the 'alloc' metadata node to represent the size of offset of buffers pointed to by pointers. This metadata can be attached to any instruction returning a pointer llvm-svn: 158688
* add the 'alloc' metadata node to represent the size of offset of buffers ↵Nuno Lopes2012-06-181-0/+33
| | | | | | | | pointed to by pointers. This metadata can be attached to any instruction returning a pointer llvm-svn: 158660
* Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer2012-06-021-1/+1
| | | | llvm-svn: 157885
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-021-2/+2
| | | | | | IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()" llvm-svn: 157884
* Use dominates(Instruction, Use) in the verifier.Rafael Espindola2012-06-011-46/+2
| | | | | | | This removes a bit of context from the verifier erros, but reduces code duplication in a fairly critical part of LLVM and makes dominates easier to test. llvm-svn: 157845
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-011-2/+2
| | | | | | | | | IntItem cleanup. IntItemBase, IntItemConstantIntImp and IntItem merged into IntItem. All arithmetic operators was propogated from APInt. Also added comparison operators <,>,<=,>=. Currently you will find set of macros that propogates operators from APInt to IntItem in the beginning of IntegerSubset. Note that THESE MACROS WILL REMOVED after all passes will case-ranges compatible. Also note that these macros much smaller pain that something like this: if (V->getValue().ugt(AnotherV->getValue()) { ... } These changes made IntItem full featured integer object. It allows to make IntegerSubset class generic (move out all ConstantInt references inside and add unit-tests) in next commits. llvm-svn: 157810
* Fix typos noticed by Benjamin Kramer.Rafael Espindola2012-05-311-10/+29
| | | | | | | Also make the checks stronger and test that we reject ranges that overlap a previous wrapped range. llvm-svn: 157749
* Require intervals in the range metadata to be in a canonical form: They mustRafael Espindola2012-05-311-2/+16
| | | | | | | | | | | be non contiguous, non overlapping and sorted by the lower end. While this is technically a backward incompatibility, every frontent currently produces range metadata with a single interval and we don't have any pass that merges intervals yet, so no existing bitcode files should be rejected by this. llvm-svn: 157741
* ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to ↵Stepan Dyatkovskiy2012-05-291-8/+8
| | | | | | IntegersSubsetMapping. llvm-svn: 157612
* PR1255: Case RangesStepan Dyatkovskiy2012-05-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now? 1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst. 2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case. 3. IntItem can be easyly easily replaced with APInt. 4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes. Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code ConstantInt *V = ...; if (V->getValue().ugt(AnotherV->getValue()) { ... } will look awful. Much more better this way: IntItem V = ConstantIntVal->getValue(); if (AnotherV < V) { } Of course any reviews are welcome. P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks). Since in future these classes will founded on APInt, it will possible to use them in more generic ways. llvm-svn: 157576
* Reimplement the intrinsic verifier to use the same table as ↵Chris Lattner2012-05-271-265/+106
| | | | | | | | | | | | | Intrinsic::getDefinition, making it stronger and more sane. Delete the code from tblgen that produced the old code. Besides being a path forward in intrinsic sanity, this also eliminates a bunch of machine generated code that was compiled into Function.o llvm-svn: 157545
* PR1255 (case ranges: work with ConstantRangesSet instead of ConstantInt) ↵Stepan Dyatkovskiy2012-05-211-6/+20
| | | | | | related changes for Execution and Verifier. llvm-svn: 157183
* Remove support for the special 'fast' value for fpmath accuracy for the moment.Duncan Sands2012-04-161-2/+0
| | | | llvm-svn: 154850
* Make it possible to indicate relaxed floating point requirements at the IR levelDuncan Sands2012-04-161-6/+10
| | | | | | | | | through the use of 'fpmath' metadata. Currently this only provides a 'fpaccuracy' value, which may be a number in ULPs or the keyword 'fast', however the intent is that this will be extended with additional information about NaN's, infinities etc later. No optimizations have been hooked up to this so far. llvm-svn: 154822
* Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'mDuncan Sands2012-04-141-6/+6
| | | | | | | | | thinking of generalizing it to be able to specify other freedoms beyond accuracy (such as that NaN's don't have to be respected). I'd like the 3.1 release (the first one with this metadata) to have the more generic name already rather than having to auto-upgrade it in 3.2. llvm-svn: 154744
* Express the number of ULPs in fpaccuracy metadata as a real rather than aDuncan Sands2012-04-101-0/+12
| | | | | | rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne. llvm-svn: 154387
* Remove always true variable.Rafael Espindola2012-03-241-19/+10
| | | | llvm-svn: 153392
OpenPOWER on IntegriCloud