summaryrefslogtreecommitdiffstats
path: root/llvm/test/Verifier
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't manually (and forcibly) run the verifier on the entire module fromChandler Carruth2014-07-301-2/+1
| | | | | | | | | | | | | the jump instruction table pass. First, the verifier is already built into all the tools. The test case is adapted to just run llvm-as demonstrating that we still catch the broken module. Second, the verifier is *extremely* slow. This was responsible for very significant compile time regressions. If you have deployed a Clang binary anywhere from r210280 to this commit, you really want to re-deploy. llvm-svn: 214287
* IR: Allow comdats to be applied to globals with internal linkageDavid Majnemer2014-07-131-1/+1
| | | | | | | | | | Our verifier check for checking if a global has local linkage was too strict. Forbid private linkage but permit local linkage. Object file formats permit this and forbidding it prevents elimination of unused, internal, vftables under the MSVC ABI. llvm-svn: 212900
* IR: Add COMDATs to the IRDavid Majnemer2014-06-272-0/+10
| | | | | | | | | | | | | | | | This new IR facility allows us to represent the object-file semantic of a COMDAT group. COMDATs allow us to tie together sections and make the inclusion of one dependent on another. This is required to implement features like MS ABI VFTables and optimizing away certain kinds of initialization in C++. This functionality is only representable in COFF and ELF, Mach-O has no similar mechanism. Differential Revision: http://reviews.llvm.org/D4178 llvm-svn: 211920
* [ValueTracking] Extend range metadata to call/invokeJingyue Wu2014-06-192-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With this patch, range metadata can be added to call/invoke including IntrinsicInst. Previously, it could only be added to load. Rename computeKnownBitsLoad to computeKnownBitsFromRangeMetadata because range metadata is not only used by load. Update the language reference to reflect this change. Test Plan: Add several tests in range-2.ll to confirm the verifier is happy with having range metadata on call/invoke. Add two tests in AddOverFlow.ll to confirm annotating range metadata to call/invoke can benefit InstCombine. Reviewers: meheff, nlewycky, reames, hfinkel, eliben Reviewed By: eliben Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4187 llvm-svn: 211281
* Move test for r210734 to Feature/aliases.ll.Bob Wilson2014-06-121-4/+0
| | | | llvm-svn: 210833
* Fix verifier for GlobalAliases to avoid recursing into global initializers.Bob Wilson2014-06-121-0/+4
| | | | | | | | | | | The verifier follows GlobalAlias operands so that it can detect cycles of alias definitions. It was doing this in a way that caused it to also recurse through initializers for the GlobalValue aliasees, and it would fail when an initializer refers to a global that is a declaration and not a definition. This patch causes it to stop recursing when it hits a global definition. <rdar://problem/17277451> llvm-svn: 210734
* Add a new attribute called 'jumptable' that creates jump-instruction tables ↵Tom Roeder2014-06-051-0/+9
| | | | | | | | | | | | for functions marked with this attribute. It includes a pass that rewrites all indirect calls to jumptable functions to pass through these tables. This also adds backend support for generating the jump-instruction tables on ARM and X86. Note that since the jumptable attribute creates a second function pointer for a function, any function marked with jumptable must also be marked with unnamed_addr. llvm-svn: 210280
* Allow alias to point to an arbitrary ConstantExpr.Rafael Espindola2014-06-032-0/+25
| | | | | | | | | | | | | | | | | | | | | This patch changes GlobalAlias to point to an arbitrary ConstantExpr and it is up to MC (or the system assembler) to decide if that expression is valid or not. This reduces our ability to diagnose invalid uses and how early we can spot them, but it also lets us do things like @test5 = alias inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32), i32 ptrtoint (i32* @bar to i32)) to i32*) An important implication of this patch is that the notion of aliased global doesn't exist any more. The alias has to encode the information needed to access it in its metadata (linkage, visibility, type, etc). Another consequence to notice is that getSection has to return a "const char *". It could return a NullTerminatedStringRef if there was such a thing, but when that was proposed the decision was to just uses "const char*" for that. llvm-svn: 210062
* Add comdat key field to llvm.global_ctors and llvm.global_dtorsReid Kleckner2014-05-161-0/+11
| | | | | | | | | | | | | | This allows us to put dynamic initializers for weak data into the same comdat group as the data being initialized. This is necessary for MSVC ABI compatibility. Once we have comdats for guard variables, we can use the combination to help GlobalOpt fire more often for weak data with guarded initialization on other platforms. Reviewers: nlewycky Differential Revision: http://reviews.llvm.org/D3499 llvm-svn: 209015
* Fix most of PR10367.Rafael Espindola2014-05-162-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the design of GlobalAlias so that it doesn't take a ConstantExpr anymore. It now points directly to a GlobalObject, but its type is independent of the aliasee type. To avoid changing all alias related tests in this patches, I kept the common syntax @foo = alias i32* @bar to mean the same as now. The cases that used to use cast now use the more general syntax @foo = alias i16, i32* @bar. Note that GlobalAlias now behaves a bit more like GlobalVariable. We know that its type is always a pointer, so we omit the '*'. For the bitcode, a nice surprise is that we were writing both identical types already, so the format change is minimal. Auto upgrade is handled by looking through the casts and no new fields are needed for now. New bitcode will simply have different types for Alias and Aliasee. One last interesting point in the patch is that replaceAllUsesWith becomes smart enough to avoid putting a ConstantExpr in the aliasee. This seems better than checking and updating every caller. A followup patch will delete getAliasedGlobal now that it is redundant. Another patch will add support for an explicit offset. llvm-svn: 209007
* musttail: Fix the verification of alignment attributesReid Kleckner2014-05-151-0/+7
| | | | | | | Previously this would fail with an assertion failure when trying to add an alignment attribute without a value. llvm-svn: 208935
* Allow sret on the second parameter as well as the firstReid Kleckner2014-05-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | MSVC always places the implicit sret parameter after the implicit this parameter of instance methods. We used to handle this for x86_thiscallcc by allocating the sret parameter on the stack and leaving the this pointer in ecx, but that doesn't handle alternative calling conventions like cdecl, stdcall, fastcall, or the win64 convention. Instead, change the verifier to allow sret on the second parameter. This also requires changing the Mips and X86 backends to return the argument with the sret parameter, instead of assuming that the sret parameter comes first. The Sparc backend also returns sret parameters in a register, but I wasn't able to update it to handle secondary sret parameters. It currently calls report_fatal_error if you feed it an sret in the second parameter. Reviewers: rafael.espindola, majnemer Differential Revision: http://reviews.llvm.org/D3617 llvm-svn: 208453
* IR: Conservatively verify inalloca argumentsDavid Majnemer2014-04-301-0/+13
| | | | | | | | | | | | Summary: Try to spot obvious mismatches with inalloca use. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D3572 llvm-svn: 207676
* Add 'musttail' marker to call instructionsReid Kleckner2014-04-242-0/+91
| | | | | | | | | | | | This is similar to the 'tail' marker, except that it guarantees that tail call optimization will occur. It also comes with convervative IR verification rules that ensure that tail call optimization is possible. Reviewers: nicholas Differential Revision: http://llvm-reviews.chandlerc.com/D3240 llvm-svn: 207143
* Reject alias to undefined symbols in the verifier.Rafael Espindola2014-03-121-0/+12
| | | | | | | | | | | | | | | On ELF and COFF an alias is just another name for a position in the file. There is no way to refer to a position in another file, so an alias to undefined is meaningless. MachO currently doesn't support aliases. The spec has a N_INDR, which when implemented will have a different set of restrictions. Adding support for it shouldn't be harder than any other IR extension. For now, having the IR represent what is actually possible with current tools makes it easier to fix the design of GlobalAlias. llvm-svn: 203705
* IR: Change inalloca's grammar a bitDavid Majnemer2014-03-092-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The grammar for LLVM IR is not well specified in any document but seems to obey the following rules: - Attributes which have parenthesized arguments are never preceded by commas. This form of attribute is the only one which ever has optional arguments. However, not all of these attributes support optional arguments: 'thread_local' supports an optional argument but 'addrspace' does not. Interestingly, 'addrspace' is documented as being a "qualifier". What constitutes a qualifier? I cannot find a definition. - Some attributes use a space between the keyword and the value. Examples of this form are 'align' and 'section'. These are always preceded by a comma. - Otherwise, the attribute has no argument. These attributes do not have a preceding comma. Sometimes an attribute goes before the instruction, between the instruction and it's type, or after it's type. 'atomicrmw' has 'volatile' between the instruction and the type while 'call' has 'tail' preceding the instruction. With all this in mind, it seems most consistent for 'inalloca' on an 'inalloca' instruction to occur before between the instruction and the type. Unlike the current formulation, there would be no preceding comma. The combination 'alloca inalloca' doesn't look particularly appetizing, perhaps a better spelling of 'inalloca' is down the road. llvm-svn: 203376
* [PM] Make the verifier work independently of any pass manager.Chandler Carruth2014-01-191-3/+2
| | | | | | | | | | | | | | | | | | | | | | | This makes the 'verifyFunction' and 'verifyModule' functions totally independent operations on the LLVM IR. It also cleans up their API a bit by lifting the abort behavior into their clients and just using an optional raw_ostream parameter to control printing. The implementation of the verifier is now just an InstVisitor with no multiple inheritance. It also is significantly more const-correct, and hides the const violations internally. The two layers that force us to break const correctness are building a DomTree and dispatching through the InstVisitor. A new VerifierPass is used to implement the legacy pass manager interface in terms of the other pieces. The error messages produced may be slightly different now, and we may have slightly different short circuiting behavior with different usage models of the verifier, but generally everything works equivalently and this unblocks wiring the verifier up to the new pass manager. llvm-svn: 199569
* Add an inalloca flag to allocasReid Kleckner2014-01-172-3/+21
| | | | | | | | | | | | | | | | Summary: The only current use of this flag is to mark the alloca as dynamic, even if its in the entry block. The stack adjustment for the alloca can never be folded into the prologue because the call may clear it and it has to be allocated at the top of the stack. Reviewers: majnemer CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2571 llvm-svn: 199525
* Change inalloca rules to make it only apply to the last parameterReid Kleckner2014-01-163-3/+15
| | | | | | | | | | | This makes things a lot easier, because we can now talk about the "argument allocation", which allocates all the memory for the call in one shot. The only functional change is to the verifier for a feature that hasn't shipped yet. llvm-svn: 199434
* Fix all the verifier tests I added for address spaces.Matt Arsenault2014-01-0210-10/+29
| | | | | | | | | I originally had these using opt -verify, and I never removed the -verify when converting them to use llvm-as instead, so these were failing because of using the -verify argument which llvm-as doesn't have instead of what it's actually supposed to be testing. llvm-svn: 198352
* Begin adding docs and IR-level support for the inalloca attributeReid Kleckner2013-12-192-0/+40
| | | | | | | | | | | | | | | | | | | The inalloca attribute is designed to support passing C++ objects by value in the Microsoft C++ ABI. It behaves the same as byval, except that it always implies that the argument is in memory and that the bytes are never copied. This attribute allows the caller to take the address of an outgoing argument's memory and execute arbitrary code to store into it. This patch adds basic IR support, docs, and verification. It does not attempt to implement any lowering or fix any possibly broken transforms. When this patch lands, a complete description of this feature should appear at http://llvm.org/docs/InAlloca.html . Differential Revision: http://llvm-reviews.chandlerc.com/D2173 llvm-svn: 197645
* Grow the stackmap/patchpoint format to hold 64-bit IDs.Andrew Trick2013-12-131-3/+3
| | | | llvm-svn: 197255
* Fix the segfault reported in PR 11990.Kaelyn Uhrain2013-12-073-0/+37
| | | | | | | | The sefault occurs due to an infinite loop when the verifier tries to determine the size of a type of the form "%rt = type { %rt }" while checking an alloca of the type. llvm-svn: 196626
* Add Verifier test case for variable argument intrinsics.Andrew Trick2013-10-311-0/+16
| | | | llvm-svn: 193768
* Add support for metadata representing .ident directives.Rafael Espindola2013-10-163-0/+35
| | | | llvm-svn: 192764
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-161-1/+0
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. llvm-svn: 188513
* Reject bitcasts between address spaces with different sizesMatt Arsenault2013-07-319-0/+97
| | | | llvm-svn: 187506
* Fix typo in test.Jakub Staszak2013-07-221-1/+1
| | | | llvm-svn: 186876
* Disallow global aliases to bitcast between address spacesMatt Arsenault2013-07-201-0/+8
| | | | llvm-svn: 186767
* s/compiler_used/compiler.used/.Rafael Espindola2013-07-191-2/+2
| | | | | | | We were incorrectly using compiler_used instead of compiler.used. Unfortunately the passes using the broken name had tests also using the broken name. llvm-svn: 186705
* Also verify llvm.compiler_used.Rafael Espindola2013-04-221-0/+6
| | | | llvm-svn: 180020
* Clarify that llvm.used can contain aliases.Rafael Espindola2013-04-225-0/+28
| | | | | | | Also add a check for llvm.used in the verifier and simplify clients now that they can assume they have a ConstantArray. llvm-svn: 180019
* Rewrite test/Verifier tests to use FileCheck instead of grepEli Bendersky2013-04-0813-19/+28
| | | | llvm-svn: 179036
* [IR] Add 'Append' and 'AppendUnique' module flag behaviors.Daniel Dunbar2013-01-161-1/+10
| | | | llvm-svn: 172659
* [IR] Add verification for module flags with the "require" behavior.Daniel Dunbar2013-01-151-2/+16
| | | | llvm-svn: 172549
* [IR] Add verifier support for llvm.module.flags.Daniel Dunbar2013-01-151-0/+37
| | | | | | | - Also, update the LangRef documentation on module flags to match the implementation. llvm-svn: 172498
* Assert that dominates is not given a multiple edge. Finding out if we haveRafael Espindola2012-08-171-1/+0
| | | | | | | | | | | | | 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
* The normal edge of an invoke is not allowed to branch to a block with aEli Friedman2012-08-101-2/+17
| | | | | | landingpad. Enforce it in the verifier, and fix the regression tests to match. llvm-svn: 161697
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160621
* Fix the remaining TCL-style quotes found in the testsuite. This isChandler Carruth2012-07-021-1/+1
| | | | | | | | | | | | | | | | | another mechanical change accomplished though the power of terrible Perl scripts. I have manually switched some "s to 's to make escaping simpler. While I started this to fix tests that aren't run in all configurations, the massive number of tests is due to a really frustrating fragility of our testing infrastructure: things like 'grep -v', 'not grep', and 'expected failures' can mask broken tests all too easily. Essentially, I'm deeply disturbed that I can change the testsuite so radically without causing any change in results for most platforms. =/ llvm-svn: 159547
* Convert the uses of '|&' to use '2>&1 |' instead, which works on oldChandler Carruth2012-07-0216-16/+16
| | | | | | | | | | versions of Bash. In addition, I can back out the change to the lit built-in shell test runner to support this. This should fix the majority of fallout on Darwin, but I suspect there will be a few straggling issues. llvm-svn: 159544
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-0211-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | This was done through the aid of a terrible Perl creation. I will not paste any of the horrors here. Suffice to say, it require multiple staged rounds of replacements, state carried between, and a few nested-construct-parsing hacks that I'm not proud of. It happens, by luck, to be able to deal with all the TCL-quoting patterns in evidence in the LLVM test suite. If anyone is maintaining large out-of-tree test trees, feel free to poke me and I'll send you the steps I used to convert things, as well as answer any painful questions etc. IRC works best for this type of thing I find. Once converted, switch the LLVM lit config to use ShTests the same as Clang. In addition to being able to delete large amounts of Python code from 'lit', this will also simplify the entire test suite and some of lit's architecture. Finally, the test suite runs 33% faster on Linux now. ;] For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s llvm-svn: 159525
* Make tests which first provide a negative assertion via 'not', thenChandler Carruth2012-07-021-1/+2
| | | | | | | | | | | | | | | | a pipeline, and then a positive assertion via grep, use two RUN lines instead. Supporting these complex ideas of 'success' and 'failure' across multiple stages of a pipeline is brittle in the shell world, and would block switching to ShTest format; it only worked due to contrivances introduced by the TclTest format. Writing this as two separate RUN lines seems clearer in any event. This is another step toward completely removing TclTests from lit. llvm-svn: 159524
* make the verifier accept @llvm.donothing as the only intrinsic that can be ↵Nuno Lopes2012-06-283-24/+65
| | | | | | | | invoked While at it, merge 2 tests and FileCheckize them llvm-svn: 159388
* revert r158660, since Chris has some issues with this patch (namely using ↵Nuno Lopes2012-06-182-67/+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-182-0/+67
| | | | | | | | pointed to by pointers. This metadata can be attached to any instruction returning a pointer llvm-svn: 158660
* Use dominates(Instruction, Use) in the verifier.Rafael Espindola2012-06-011-2/+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
* Add some tests checking that the verifier rejects cases where a definitionRafael Espindola2012-06-011-0/+57
| | | | | | doesn't dominate a use. llvm-svn: 157829
* Fix typos noticed by Benjamin Kramer.Rafael Espindola2012-05-311-5/+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-312-0/+54
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud