summaryrefslogtreecommitdiff
path: root/test/TableGen
Commit message (Collapse)AuthorAge
* [TableGen] Correctly generate implicit anonymous prototype defs in multiclassesHal Finkel2014-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | | Even within a multiclass, we had been generating concrete implicit anonymous defs when parsing values (generally in value lists). This behavior was incorrect, and led to errors when multiclass parameters were used in the parameter list of the implicit anonymous def. If we had some multiclass: multiclass mc<string n> { ... : SomeClass<SomeOtherClass<n> > The capture of the multiclass parameter 'n' would not work correctly, and depending on how the implicit SomeOtherClass was used, either TableGen would ignore something it shouldn't, or would crash. To fix this problem, when inside a multiclass, we generate prototype anonymous defs for implicit anonymous defs (just as we do for explicit anonymous defs). Within the multiclass, the current record prototype is populated with a node that is essentially: !cast<SomeOtherClass>(!strconcat(NAME, anon_value_name)). This is then resolved to the correct concrete anonymous def, in the usual way, when NAME is resolved during multiclass instantiation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198348 91177308-0d34-0410-b5e6-96231b3b80d8
* [TableGen] Use the same anonymous name as the prefix on all multiclass defsHal Finkel2014-01-02
| | | | | | | | | | | | | | | | TableGen had been generating a different name for an anonymous multiclass's NAME for every def in the multiclass. This had an unfortunate side effect: it was impossible to reference one def within the multiclass from another (in the parameter list, for example). By making sure we only generate an anonymous name once per multiclass (which, as it turns out, requires only changing the name parameter to reference type), we can now concatenate NAME within the multiclass with a def name in order to generate a reference to that def. This does not matter so much, in and of itself, but is necessary for a follow-up commit that will fix variable capturing in implicit anonymous multiclass defs (and that is important). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198340 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheckize r197869Alp Toker2013-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197872 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax tab check into a whitespace check to fix the test in r197869Alp Toker2013-12-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197870 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: Generate valid identifiers for anonymous recordsAlp Toker2013-12-21
| | | | | | | | | | Backends like OptParserEmitter assume that record names can be used as valid identifiers. The period '.' in generated anonymous names broke that assumption, causing a build-time error and in practice forcing all records to be named. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197869 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark 36 tests as XFAIL:vg_leak in llvm/test/TableGen.NAKAMURA Takumi2013-11-10
| | | | | | | In historical reason, tblgen is not strictly required to be free from memory leaks. For now, I mark them as XFAIL, they could be fixed, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194353 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 6 of XFAIL(s) in llvm/test/TableGen, since r193736. They have been ↵NAKAMURA Takumi2013-11-10
| | | | | | XPASSing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194352 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable variable arguments support for intrinsics.Andrew Trick2013-10-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193766 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheckize some tests.Bill Wendling2013-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189060 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in TableGen where the intrinsic function name recognizer could ↵Justin Holewinski2013-07-25
| | | | | | | | | | | | | | | | | mis-identify names if one was a prefix substring of the other For two intrinsics 'llvm.nvvm.texsurf.handle' and 'llvm.nvvm.texsurf.handle.internal', TableGen was emitting matching code like: if (Name.startswith("llvm.nvvm.texsurf.handle")) ... if (Name.startswith("llvm.nvvm.texsurf.handle.internal")) ... We can never match "llvm.nvvm.texsurf.handle.internal" here because it will always be erroneously matched by the first condition. The fix is to sort the intrinsic names and emit them in reverse order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187119 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow TableGen DAG arguments to be just a name.Jakob Stoklund Olesen2013-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | DAG arguments can optionally be named: (dag node, node:$name) With this change, the node is also optional: (dag node, node:$name, $name) The missing node is treated as an UnsetInit, so the above is equivalent to: (dag node, node:$name, ?:$name) This syntax is useful in output patterns where we currently require the types of variables to be repeated: def : Pat<(subc i32:$b, i32:$c), (SUBCCrr i32:$b, i32:$c)>; This is preferable: def : Pat<(subc i32:$b, i32:$c), (SUBCCrr $b, $c)>; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177843 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck-ify some grep testsReid Kleckner2013-01-25
| | | | | | | | These tests in particular try to use escaped square brackets as an argument to grep, which is failing for me with native win32 python. It appears the backslash is being lost near the CreateProcess*() call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173506 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve the !add TableGen test case.Hal Finkel2013-01-25
| | | | | | Suggested by Sean Silva. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173481 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an addition operator to TableGenHal Finkel2013-01-25
| | | | | | | This adds an !add(a, b) operator to tablegen; this will be used to cleanup the PPC register definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173445 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo, which prevent test from being check.Jakub Staszak2012-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170025 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/test/TableGen: Remove XFAIL:vg_leak in dozen of tests, according to ↵NAKAMURA Takumi2012-12-11
| | | | | | llvm-x86_64-linux-vg_leak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169862 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-work bit/bits value resolving in tblgenMichael Liao2012-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This patch is inspired by the failure of the following code snippet which is used to convert enumerable values into encoding bits to improve the readability of td files. class S<int s> { bits<2> V = !if(!eq(s, 8), {0, 0}, !if(!eq(s, 16), {0, 1}, !if(!eq(s, 32), {1, 0}, !if(!eq(s, 64), {1, 1}, {?, ?})))); } Later, PR8330 is found to report not exactly the same bug relevant issue to bit/bits values. - Instead of resolving bit/bits values separately through resolveBitReference(), this patch adds getBit() for all Inits and resolves bit value by resolving plus getting the specified bit. This unifies the resolving of bit with other values and removes redundant logic for resolving bit only. In addition, BitsInit::resolveReferences() is optimized to take advantage of this origanization by resolving VarBitInit's variable reference first and then getting bits from it. - The type interference in '!if' operator is revised to support possible combinations of int and bits/bit in MHS and RHS. - As there may be illegal assignments from integer value to bit, says assign 2 to a bit, but we only check this during instantiation in some cases, e.g. bit V = !if(!eq(x, 17), 0, 2); Verbose diagnostic message is generated when invalid value is resolveed to help locating the error. - PR8330 is fixed as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163360 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-02
| | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159525 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for range expressions in TableGen foreach loops.Jakob Stoklund Olesen2012-05-24
| | | | | | | | | | | | Like this: foreach i = 0-127 in ... Use braces for composite ranges: foreach i = {0-3,9-7} in ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157432 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't put TGParser scratch results in the output.Jakob Stoklund Olesen2012-05-24
| | | | | | Only fully expanded Records should go into RecordKeeper. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157431 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach tblgen's set theory "sequence" operator to support an optional stride ↵Owen Anderson2012-05-24
| | | | | | operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157416 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix infinite loop in nested multiclasses.Jakob Stoklund Olesen2012-03-07
| | | | | | Patch by Michael Liao! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152232 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Foreach LoopDavid Greene2012-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some data structures to represent for loops. These will be referenced during object processing to do any needed iteration and instantiation. Add foreach keyword support to the lexer. Add a mode to indicate that we're parsing a foreach loop. This allows the value parser to early-out when processing the foreach value list. Add a routine to parse foreach iteration declarations. This is separate from ParseDeclaration because the type of the named value (the iterator) doesn't match the type of the initializer value (the value list). It also needs to add two values to the foreach record: the iterator and the value list. Add parsing support for foreach. Add the code to process foreach loops and create defs based on iterator values. Allow foreach loops to be matched at the top level. When parsing an IDValue check if it is a foreach loop iterator for one of the active loops. If so, return a VarInit for it. Add Emacs keyword support for foreach. Add VIM keyword support for foreach. Add tests to check foreach operation. Add TableGen documentation for foreach. Support foreach with multiple objects. Support non-braced foreach body with one object. Do not require types for the foreach declaration. Assume the iterator type from the iteration list element type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151164 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-16
| | | | | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an (interleave A, B, ...) SetTheory operator.Jakob Stoklund Olesen2012-01-24
| | | | | | This will interleave the elements from two or more lists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148824 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL test on leak checkers.Benjamin Kramer2011-10-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142804 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Paste TestDavid Greene2011-10-19
| | | | | | This tests TableGen's paste functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142526 91177308-0d34-0410-b5e6-96231b3b80d8
* Add NAME MemberDavid Greene2011-10-19
| | | | | | | | Add a Value named "NAME" to each Record. This will be set to the def or defm name when instantiating multiclasses. This will replace the #NAME# processing hack once paste functionality is in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142518 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL tblgen tests on leak checkers.Benjamin Kramer2011-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141533 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MultidefsDavid Greene2011-10-07
| | | | | | | | | | | | | | | | | | | Multidefs are a bit unwieldy and incomplete. Remove them in favor of another mechanism, probably for loops. Revert "Make Test More Thorough" Revert "Fix a typo." Revert "Vim Support for Multidefs" Revert "Emacs Support for Multidefs" Revert "Document Multidefs" Revert "Add a Multidef Test" Revert "Update Test for Multidefs" Revert "Process Multidefs" Revert "Parser Multidef Support" Revert "Lexer Support for Multidefs" Revert "Add Multidef Data Structures" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141378 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Test More ThoroughDavid Greene2011-10-06
| | | | | | | | Check that all ADD patters are processed. Add a SUB test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141314 91177308-0d34-0410-b5e6-96231b3b80d8
* s/tblgen/llvm-tblgen/g in a few missed places, including the testsPeter Collingbourne2011-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141294 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Test for MultidefsDavid Greene2011-10-05
| | | | | | Update the MultiPat.td test to create some defs via multidefs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141235 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Multidef TestDavid Greene2011-10-05
| | | | | | Add a simple test for multidefs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141234 91177308-0d34-0410-b5e6-96231b3b80d8
* Test Operand ArgumentsDavid Greene2011-10-04
| | | | | | | | | Add a test to do list manipulation and pass the result as arguments. This tests the new list element operator resolve code and provides an example of using list manipulation to do instruction pattern substitution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141102 91177308-0d34-0410-b5e6-96231b3b80d8
* Test More Complicated ListsDavid Greene2011-09-30
| | | | | | | Test of indexing lists of lists of lists works. This also exercises some operators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140884 91177308-0d34-0410-b5e6-96231b3b80d8
* Test VarListElementInit:: resolveListElementReferenceDavid Greene2011-09-30
| | | | | | Add a TableGen test to check if indexing lists of lists works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140883 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverted r138652, valgrind doesn't understand obj:*/tblgen.Andrew Trick2011-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138703 91177308-0d34-0410-b5e6-96231b3b80d8
* valgrind: Always suppress tblgen leaks.Andrew Trick2011-08-26
| | | | | | | I'll clean up the rest of the XFAIL: vg_leak lines if this works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138652 91177308-0d34-0410-b5e6-96231b3b80d8
* We don't care if TableGen leaks memory.Benjamin Kramer2011-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138634 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach TableGen to evaluate DAG expressions as set operations.Jakob Stoklund Olesen2011-06-04
| | | | | | | | | | | | | | | | | A TableGen backend can define how certain classes can be expanded into ordered sets of defs, typically by evaluating a specific field in the record. The SetTheory class can then evaluate DAG expressions that refer to these named sets. A number of standard set and list operations are predefined, and the backend can add more specialized operators if needed. The -print-sets backend is used by SetTheory.td to provide examples. This is intended to simplify how register classes are defined: def GR32_NOSP : RegisterClass<"X86", [i32], 32, (sub GR32, ESP)>; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132621 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-15
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename lisp-like functions as suggested by Gabor Greif as loooong timeDavid Greene2011-01-07
| | | | | | | ago. This is both easier to learn and easier to read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123001 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for using the `!if' operator when initializing variables:Bill Wendling2010-12-13
| | | | | | | | | | | | class A<bit a, bits<3> x, bits<3> y> { bits<3> z; let z = !if(a, x, y); } The variable z will get the value of x when 'a' is 1 and 'y' when a is '0'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121666 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize tblgen's dag parsing logic to handle arbitrary expressionsChris Lattner2010-10-06
| | | | | | | | | | | | | | | | as the operator of the dag. Specifically, this allows parsing things like (F.x 4) in addition to just (a 4). Unfortunately, this runs afoul of an idiom being used by llvmc. It is using dags like (foo [1,2,3]) to represent a list of stuff being passed into foo. With this change, this is parsed as a [1,2,3] subscript on foo instead of being the first argument to the dag. Cope with this in the short term by requiring a "-llvmc-temp-hack" argument to tblgen to get the old parsing behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115742 91177308-0d34-0410-b5e6-96231b3b80d8
* rename add some comments.Chris Lattner2010-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115741 91177308-0d34-0410-b5e6-96231b3b80d8
* filecheckizeChris Lattner2010-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115740 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the !nameconcat tblgen feature. It "shorthand" and only used in 4 placesChris Lattner2010-10-06
| | | | | | | where !cast is just as short. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115722 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance tblgen to support anonymous defm's, use this toChris Lattner2010-10-05
| | | | | | | simplify the X86 CMOVmr's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115702 91177308-0d34-0410-b5e6-96231b3b80d8
* tests: XFAIL a handful of tests on the vg_leak builder, so we can get back toDaniel Dunbar2010-09-09
| | | | | | green. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113491 91177308-0d34-0410-b5e6-96231b3b80d8