History log of /external/llvm/include/llvm/TableGen/Record.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
135fe6ac5f5b80ef68c19b3ec7bb0063e28f2bab 22-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> Speling fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193165 91177308-0d34-0410-b5e6-96231b3b80d8
f801b8fe7ace6306b653f5ea68c378f35e9f2d6d 02-Jul-2013 Richard Trieu <rtrieu@google.com> Fix up some asserts that are within an if statement. This removes the need
for assert(0 && "text").

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185396 91177308-0d34-0410-b5e6-96231b3b80d8
c09324483cf8c8904b7250f072d8f64e9b00656e 28-Jun-2013 Richard Trieu <rtrieu@google.com> Fix broken asserts that never fire.

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
ff4196adcf602cbe0581f3240c3fef0847159550 27-Jun-2013 Chad Rosier <mcrosier@apple.com> Remove unnecessary conditional checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185096 91177308-0d34-0410-b5e6-96231b3b80d8
b7110cf5b5e4832e8ded6db7ab7577e3cfa2c462 27-Jun-2013 Chad Rosier <mcrosier@apple.com> Improve the compression of the tablegen DiffLists by introducing a new sort
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:


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:

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


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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185094 91177308-0d34-0410-b5e6-96231b3b80d8
64110ffc9eecbe999c29ac9d9f6697447a110036 15-Mar-2013 Jakob Stoklund Olesen <stoklund@2pi.dk> Add SchedRW as an Instruction field.

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
1b2c94713600531ddeefb23cd10c49cd533aa09b 05-Feb-2013 Eli Bendersky <eliben@google.com> Fix comment formatting

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174388 91177308-0d34-0410-b5e6-96231b3b80d8
d23a41c153712b929bd84f5e713bda5db5d6e66d 25-Jan-2013 Hal Finkel <hfinkel@anl.gov> Add an addition operator to TableGen

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
b50df4a3df6db2ace3c011267934d3d10bdcc8db 10-Jan-2013 Jordan Rose <jordan_rose@apple.com> TableGen: Keep track of superclass reference ranges.

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
d122009e57217bd574703c46dd14b1a9235ed0b7 10-Jan-2013 Jordan Rose <jordan_rose@apple.com> TableGen: record anonymous instantiations of classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172084 91177308-0d34-0410-b5e6-96231b3b80d8
37fda193d292d78c672b8019723c7907af312c43 07-Jan-2013 Sean Silva <silvas@purdue.edu> Simplify TableGen type-compatibility checks.

Patch by Elior Malul!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171684 91177308-0d34-0410-b5e6-96231b3b80d8
255f89faee13dc491cb64fbeae3c763e7e2ea4e6 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort the #include lines for the include/... tree with the script.

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
ed84062812c7b8a82d0e8128a22aa1aa07a14d79 12-Oct-2012 Sean Silva <silvas@purdue.edu> Remove unnecessary classof()'s

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
b0c6fa3b4b74d9cd03beb5a4cb9702abc85ac169 10-Oct-2012 Sean Silva <silvas@purdue.edu> tblgen: Put dyn_cast<> machinery in place for Init hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165645 91177308-0d34-0410-b5e6-96231b3b80d8
63554988a94b8a4bcf3de77659a0b27c07a0975d 05-Oct-2012 Sean Silva <silvas@purdue.edu> tblgen: Use appropriate LLVM-style RTTI functions.

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
736ceace11249da645ec4ed91b8714832193ead4 05-Oct-2012 Sean Silva <silvas@purdue.edu> tblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.

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
89adeb225db4cd4d5c671d2ac5e2e6a6e755b5bc 05-Oct-2012 Sean Silva <silvas@purdue.edu> tblgen: Put dyn_cast<> infrastructure in place for RecTy hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165290 91177308-0d34-0410-b5e6-96231b3b80d8
cdac1be34a0b329f1bd2232a3f4995432f633c3c 19-Sep-2012 Owen Anderson <resistor@mac.com> Implement a correct copy constructor for Record. Now that we're using the 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
90fee07298bec2e5160a599db850b9553d02377b 19-Sep-2012 Sean Silva <silvas@purdue.edu> Refactor Record* by-ID comparator to Record.h

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
a558d91cedd4fd5c2d3327a8a18e12c35530efa8 16-Sep-2012 Craig Topper <craig.topper@gmail.com> Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164007 91177308-0d34-0410-b5e6-96231b3b80d8
ef072c33150af8035024e6ac3d52b4861f4d6928 16-Sep-2012 Craig Topper <craig.topper@gmail.com> Add explicit virtual keywords for methods that override base class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163996 91177308-0d34-0410-b5e6-96231b3b80d8
236bcf1fcd6164d624956c0858593c1a780b9a0b 09-Sep-2012 Aaron Ballman <aaron@aaronballman.com> Fixing a type width warning with MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163481 91177308-0d34-0410-b5e6-96231b3b80d8
307525cd24c3b9c081ddb3c34a3418f2875cd556 07-Sep-2012 Michael Liao <michael.liao@intel.com> Re-work bit/bits value resolving in tblgen

- 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
c1f10fd5b9a780d1c42dca7143d7a8acd9bd9377 23-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Tristate mayLoad, mayStore, and hasSideEffects.

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
376a8a773e38fdcd9102a40e08ab1e0661d645d9 23-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Print out the location of expanded multiclass defs in TableGen errors.

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
72cba6cdf640411e2fb6207858a0abd87c4286fc 25-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't put TGParser scratch results in the output.

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
4b18691c3580674691875ec37c84a1c4edf2d586 18-Apr-2012 Jim Grosbach <grosbach@apple.com> Tidy up. Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155013 91177308-0d34-0410-b5e6-96231b3b80d8
cebb4ee93a0064e4a2cb1fd1da7455b01e5655cb 22-Feb-2012 David Greene <greened@obbligato.org> Add Foreach Loop

Add some data structures to represent for loops. These will be
referenced during object processing to do any needed iteration and

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
50bee42b54cd9aec5f49566307df2b0cf23afcf6 05-Feb-2012 Craig Topper <craig.topper@gmail.com> Convert assert(0) to llvm_unreachable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149849 91177308-0d34-0410-b5e6-96231b3b80d8
8dd6f0c8353f80de6526810899f271d539f6929c 13-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete CodeInit and CodeRecTy from TableGen.

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
ebaf92c67dac4974f98a08f8096d3eb2f4edd09d 13-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Use uniqued StringInit pointers for lookups.

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
2d24e2a396a1d211baaeedf32148a3b657240170 20-Dec-2011 David Blaikie <dblaikie@gmail.com> Unweaken vtables as per 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
e338565757bfcfe9d762751c976684f66954fb45 19-Oct-2011 David Greene <greened@obbligato.org> Add NAME Member

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
004adaf3452a355ada2a54bcb61dc8925a718651 19-Oct-2011 David Greene <greened@obbligato.org> Call Record Initializer

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
675f85d0f240930d571f4e557bb92237ee48124e 19-Oct-2011 David Greene <greened@obbligato.org> Add Name Init Record Constructor

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
0abdadbce7e04af76145154d75ca41dab749b8d6 19-Oct-2011 David Greene <greened@obbligato.org> Fix 80-col Violation

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
0615d6aac810059a37fbced0f315cce75476da49 19-Oct-2011 David Greene <greened@obbligato.org> Fix Name Check

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
7474c29d903d479e7f99eb0d1d097f75289c5f48 19-Oct-2011 David Greene <greened@obbligato.org> Fix Name Check

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
f7931b7040de1c829e678b4e391308bc3376f8a0 19-Oct-2011 David Greene <greened@obbligato.org> Add Record Init

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
e22b321d2276b634519165b101b02d92c2fcf5c7 19-Oct-2011 David Greene <greened@obbligato.org> Make Template Arg Names Inits

Allow template arg names to be Inits. This is further work to
implement paste as it allows template names to participate in paste

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142500 91177308-0d34-0410-b5e6-96231b3b80d8
30c2225b3c4a89b527ee38542ab8990ca0a682f1 19-Oct-2011 David Greene <greened@obbligato.org> Add Utility to Scope Names

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
ee6dca17252de152720655282fb4b74b76fb2fe9 19-Oct-2011 David Greene <greened@obbligato.org> Make VarInit Name an Init

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
96a9f78c4aa1bc188f3f7ee869bed44cb7a6ff0e 19-Oct-2011 David Greene <greened@obbligato.org> Add Value Accessors

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
d7f8941e77fef20dc147fe102a2024cc5ccef366 19-Oct-2011 David Greene <greened@obbligato.org> Add Name Init Accessors

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
de703e25fe98f7c0dfab1750cf337a013b5c9603 19-Oct-2011 David Greene <greened@obbligato.org> Add Init Accessors

Add a couple of utility functions to get at the name init and return
the name init as a string. This will be used for paste functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142494 91177308-0d34-0410-b5e6-96231b3b80d8
a1b1b79be15c4b79a4282f148085ebad1cf877ca 07-Oct-2011 David Greene <greened@obbligato.org> Remove Multidefs

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
bda579b8bab763f0b741c5775350cda09a394115 06-Oct-2011 David Greene <greened@obbligato.org> Add Multidef Data Structures

Add a set of data structures and members analogous to those used for
multiclass defs. These will represent a new kind of multiclass def: a
multidef. The idea behind the multidef is to process a list of items
and create a def record for each one inside the enclosing multiclass.
This allows the user to dynamically create a set of defs based on the
contents of a list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141230 91177308-0d34-0410-b5e6-96231b3b80d8
7c788888872233748da10a8177a9a1eb176c1bc8 01-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Move TableGen's parser and entry point into a library

This is the first step towards splitting LLVM and Clang's tblgen executables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140951 91177308-0d34-0410-b5e6-96231b3b80d8