aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/TableGen/Record.h
Commit message (Collapse)AuthorAgeFilesLines
* Update aosp/master LLVM for rebase to r235153Pirama Arumuga Nainar2015-05-181-2/+0
| | | | | Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7 (cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987)
* Update aosp/master llvm for rebase to r233350Pirama Arumuga Nainar2015-04-091-3/+3
| | | | Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
* Update aosp/master LLVM for rebase to r230699.Stephen Hines2015-03-231-41/+39
| | | | Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
* Update aosp/master LLVM for rebase to r222494.Stephen Hines2014-12-021-40/+55
| | | | Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
* Update LLVM for 3.5 rebase (r209712).Stephen Hines2014-05-291-93/+91
| | | | Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
* Update to LLVM 3.5a.Stephen Hines2014-04-241-249/+247
| | | | Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
* Speling fixes.Benjamin Kramer2013-10-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193165 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix up some asserts that are within an if statement. This removes the needRichard Trieu2013-07-011-4/+6
| | | | | | | for assert(0 && "text"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185396 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix broken asserts that never fire.Richard Trieu2013-06-281-2/+2
| | | | | | | | | Change assert("text") to assert(0 && "text"). The first case is a const char * to bool conversion, which always evaluates to true, never triggering the assert. The second case will always trigger the assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185227 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary conditional checks.Chad Rosier2013-06-271-20/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185096 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve the compression of the tablegen DiffLists by introducing a new sortChad Rosier2013-06-271-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | algorithm when assigning EnumValues to the synthesized registers. The current algorithm, LessRecord, uses the StringRef compare_numeric function. This function compares strings, while handling embedded numbers. For example, the R600 backend registers are sorted as follows: T1 T1_W T1_X T1_XYZW T1_Y T1_Z T2 T2_W T2_X T2_XYZW T2_Y T2_Z In this example, the 'scaling factor' is dEnum/dN = 6 because T0, T1, T2 have an EnumValue offset of 6 from one another. However, in other parts of the register bank, the scaling factors are different: dEnum/dN = 5: KC0_128_W KC0_128_X KC0_128_XYZW KC0_128_Y KC0_128_Z KC0_129_W KC0_129_X KC0_129_XYZW KC0_129_Y KC0_129_Z The diff lists do not work correctly because different kinds of registers have different 'scaling factors'. This new algorithm, LessRecordRegister, tries to enforce a scaling factor of 1. For example, the registers are now sorted as follows: T1 T2 T3 ... T0_W T1_W T2_W ... T0_X T1_X T2_X ... KC0_128_W KC0_129_W KC0_130_W ... For the Mips and R600 I see a 19% and 6% reduction in size, respectively. I did see a few small regressions, but the differences were on the order of a few bytes (e.g., AArch64 was 16 bytes). I suspect there will be even greater wins for targets with larger register files. Patch reviewed by Jakob. rdar://14006013 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185094 91177308-0d34-0410-b5e6-96231b3b80d8
* Add SchedRW as an Instruction field.Jakob Stoklund Olesen2013-03-151-0/+5
| | | | | | | | | | | | | Don't require instructions to inherit Sched<...>. Sometimes it is more convenient to say: let SchedRW = ... in { ... } Which is now possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177199 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment formattingEli Bendersky2013-02-051-6/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174388 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an addition operator to TableGenHal Finkel2013-01-251-1/+1
| | | | | | | 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
* TableGen: Keep track of superclass reference ranges.Jordan Rose2013-01-101-4/+7
| | | | | | | | | | def foo : bar; ~~~ This allows us to produce more precise diagnostics about a certain superclass, and even provide fixits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172085 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: record anonymous instantiations of classes.Jordan Rose2013-01-101-5/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172084 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify TableGen type-compatibility checks.Sean Silva2013-01-071-68/+7
| | | | | | Patch by Elior Malul! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171684 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for the include/... tree with the script.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | AKA: Recompile *ALL* the source code! This one went much better. No manual edits here. I spot-checked for silliness and grep-checked for really broken edits and everything seemed good. It all still compiles. Yell if you see something that looks goofy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169133 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary classof()'sSean Silva2012-10-111-8/+0
| | | | | | | isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165767 91177308-0d34-0410-b5e6-96231b3b80d8
* tblgen: Put dyn_cast<> machinery in place for Init hierarchy.Sean Silva2012-10-101-20/+118
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165645 91177308-0d34-0410-b5e6-96231b3b80d8
* tblgen: Use appropriate LLVM-style RTTI functions.Sean Silva2012-10-051-5/+5
| | | | | | | Use isa<> or cast<> when semantically that is what is happening. Also some trivial "style" cleanups at fix sites. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165292 91177308-0d34-0410-b5e6-96231b3b80d8
* tblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.Sean Silva2012-10-051-5/+5
| | | | | | | | This is a mechanical change of dynamic_cast<> to dyn_cast<>. A number of these uses are actually more like isa<> or cast<>, and will be changed to the semanticaly appropriate one in a future patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165291 91177308-0d34-0410-b5e6-96231b3b80d8
* tblgen: Put dyn_cast<> infrastructure in place for RecTy hierarchy.Sean Silva2012-10-051-8/+62
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165290 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a correct copy constructor for Record. Now that we're using the ↵Owen Anderson2012-09-191-0/+8
| | | | | | | | | ID number as a key in maps (for determinism), it is imperative that ID numbers be globally unique, even when we copy construct a Record. This fixes some obscure failure cases involving registers defined inside multiclasses or foreach constructs that would not receive a unique ID, and would end up being omitted from the AsmMatcher tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164251 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor Record* by-ID comparator to Record.hSean Silva2012-09-191-0/+10
| | | | | | | | | | | This is a generally useful utility; there's no reason to have it hidden in CodeGenDAGPatterns.cpp. Also, rename it to fit the other comparators in Record.h Review by Jakob. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164189 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment ↵Craig Topper2012-09-161-38/+36
| | | | | | operators that aren't implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164007 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit virtual keywords for methods that override base class.Craig Topper2012-09-161-24/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163996 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing a type width warning with MSVC.Aaron Ballman2012-09-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163481 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-work bit/bits value resolving in tblgenMichael Liao2012-09-061-60/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Tristate mayLoad, mayStore, and hasSideEffects.Jakob Stoklund Olesen2012-08-231-0/+6
| | | | | | | Keep track of the set/unset state of these bits along with their true/false values, but treat '?' as '0' for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162461 91177308-0d34-0410-b5e6-96231b3b80d8
* Print out the location of expanded multiclass defs in TableGen errors.Jakob Stoklund Olesen2012-08-221-7/+11
| | | | | | | | | | | | | | | | | | | When reporting an error for a defm, we would previously only report the location of the outer defm, which is not always where the error is. Now we also print the location of the expanded multiclass defs: lib/Target/X86/X86InstrSSE.td:2902:12: error: foo defm ADD : basic_sse12_fp_binop_s<0x58, "add", fadd, SSE_ALU_ITINS_S>, ^ lib/Target/X86/X86InstrSSE.td:2801:11: note: instantiated from multiclass defm PD : sse12_fp_packed<opc, !strconcat(OpcodeStr, "pd"), OpNode, VR128, ^ lib/Target/X86/X86InstrSSE.td:194:5: note: instantiated from multiclass def rm : PI<opc, MRMSrcMem, (outs RC:$dst), (ins RC:$src1, x86memop:$src2), ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162409 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't put TGParser scratch results in the output.Jakob Stoklund Olesen2012-05-241-4/+6
| | | | | | 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
* Tidy up. Trailing whitespace.Jim Grosbach2012-04-181-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155013 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Foreach LoopDavid Greene2012-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-051-19/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149849 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete CodeInit and CodeRecTy from TableGen.Jakob Stoklund Olesen2012-01-131-87/+0
| | | | | | | The code type was always identical to a string anyway. Now it is simply a synonym. The code literal syntax [{...}] is still valid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148092 91177308-0d34-0410-b5e6-96231b3b80d8
* Use uniqued StringInit pointers for lookups.Jakob Stoklund Olesen2012-01-131-10/+13
| | | | | | | This avoids a gazillion StringMap and dynamic_cast calls, making TableGen run 3x faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148091 91177308-0d34-0410-b5e6-96231b3b80d8
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+6
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
* Add NAME MemberDavid Greene2011-10-191-0/+7
| | | | | | | | 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
* Call Record InitializerDavid Greene2011-10-191-0/+2
| | | | | | Call the common Record initializer code from constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142509 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Name Init Record ConstructorDavid Greene2011-10-191-0/+3
| | | | | | | Add a Record constructor that takes the Record name as an Init. This is more work toward paste functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142508 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 80-col ViolationDavid Greene2011-10-191-1/+3
| | | | | | Split up the initializer list for Record to avoid 80-col issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142507 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name CheckDavid Greene2011-10-191-4/+4
| | | | | | Avoid a potential assert by asking for record names as strings explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142503 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name CheckDavid Greene2011-10-191-1/+1
| | | | | | | Record names may not be fully resolved at this point so ask for the record name as a string explicitly. This avoids a potential assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142502 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Record InitDavid Greene2011-10-191-0/+1
| | | | | | Add an init function to be shared among Record constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142501 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Template Arg Names InitsDavid Greene2011-10-191-4/+10
| | | | | | | | Allow template arg names to be Inits. This is further work to implement paste as it allows template names to participate in paste operations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142500 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Utility to Scope NamesDavid Greene2011-10-191-0/+10
| | | | | | | | Add a couple of utility functions to take a variable name and qualify it with the namespace of the enclosing class and/or multiclass. This is inpreparation for making template arg names first-class Inits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142498 91177308-0d34-0410-b5e6-96231b3b80d8
* Make VarInit Name an InitDavid Greene2011-10-191-3/+9
| | | | | | | | Make the VarInit name an Init itself. We need this to implement paste functionality so we can reference variables whose names are not yet completely resolved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142497 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Value AccessorsDavid Greene2011-10-191-2/+9
| | | | | | | | Add accessors to get Record values by Init name. This lets us look up Record values whose names are not yet fully resolved. More work toward paste. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142496 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Name Init AccessorsDavid Greene2011-10-191-0/+7
| | | | | | | Add a utility to get the name init and get the string representation of the name. This will be used for paste functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142495 91177308-0d34-0410-b5e6-96231b3b80d8