Commit Graph

690 Commits

Author SHA1 Message Date
Chris Lattner
0f21fd5204 Rename MRegisterDesc -> TargetRegisterDesc for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23564 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:49:27 +00:00
Chris Lattner
22842105de remove some more initializers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23562 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:41:05 +00:00
Chris Lattner
2f02ed9a1f trim down the target info structs now that we have a preferred spill register class for each callee save register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23560 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:35:22 +00:00
Chris Lattner
4794797f12 Compute a preferred spill register class for each callee-save register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23553 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 06:44:45 +00:00
Chris Lattner
88b7e6e304 Fix a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23550 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 06:09:50 +00:00
Chris Lattner
946ac939c6 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23549 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:53:25 +00:00
Chris Lattner
c3bec0e401 Refactor this a bit to move ParsingTemplateArgs to only apply to classes,
not defs.

Implement support for forward definitions of classes.  This implements
TableGen/ForwardRef.td.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23548 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:53:04 +00:00
Chris Lattner
0a28405089 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23546 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:42:56 +00:00
Chris Lattner
583a0249b6 Generate a parse error instead of a checked exception if template args are
used on a def.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23545 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:42:31 +00:00
Chris Lattner
8d354e901f regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23543 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:11:27 +00:00
Chris Lattner
be88b50c01 Refactor the grammar a bit to implement TableGen/ForwardRef.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23542 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:10:49 +00:00
Chris Lattner
0d0b73e9f8 allow regs to be in multiple reg classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23540 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 01:33:48 +00:00
Chris Lattner
af302914d1 Teach tablegen to reassociate operators when possible. This allows it to
find all of teh pattern matches for EQV from one definition


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23529 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 22:36:54 +00:00
Chris Lattner
e46e17b7fb Teach tblgen to build permutations of instructions, so that the target author
doesn't have to specify them manually.  It currently handles associativity,
e.g. knowing that (X*Y)+Z  also matches  X+(Y*Z)  and will be extended in
the future.

It is smart enough to not introduce duplicate patterns or patterns that can
never match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23526 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 19:28:10 +00:00
Chris Lattner
7cf2fe6c48 add support for an associative marker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23502 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 20:58:06 +00:00
Chris Lattner
e97603f1bd Emit an error if instructions or patterns are defined but can never match.
Currently we check that immediate values live on the RHS of commutative
operators.  Defining ORI like this, for example:

def ORI   : DForm_4<24, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2),
                    "ori $dst, $src1, $src2",
                    [(set GPRC:$dst, (or immZExt16:$src2, GPRC:$src1))]>;

results in:

tblgen: In ORI: Instruction can never match: Immediate values must be on the RHS of commutative operators!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23501 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 19:27:25 +00:00
Chris Lattner
a1a68ae061 collect commutativity information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23499 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 18:28:29 +00:00
Chris Lattner
05814af29f Prefer cheaper patterns to more expensive ones. Print the costs to the generated
file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23492 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 17:57:56 +00:00
Chris Lattner
f6f9416363 Select Constant nodes to TargetConstant nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23488 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 16:58:06 +00:00
Chris Lattner
fab3728801 memoize the assert results
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23457 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 22:10:24 +00:00
Chris Lattner
3748147aaf Emit the switch stmt cases in alphabetical order instead of pointer order,
which is not stable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23456 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 21:59:35 +00:00
Chris Lattner
6bc7e513d5 implement a fixme: only select values once, even if used multiple times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23454 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 21:53:26 +00:00
Jeff Cohen
a48283baa3 Fix VC++ build errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23431 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-25 19:04:43 +00:00
Chris Lattner
296dfe3b8a memoize translations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23419 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-24 00:50:51 +00:00
Chris Lattner
72fe91c4dd Teach the DAG isel generator to emit code that creates nodes.
Fix a few corner cases parsing things like (i32 imm:$foo)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23417 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-24 00:40:24 +00:00
Chris Lattner
8fc3568d98 Emit better code (no more copies for var references), and support DAG patterns
(e.g. things like rotates).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23416 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-23 23:16:51 +00:00
Chris Lattner
547394ca38 Fix a fixme by passing around SDOperand's instead of SDNode*'s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23415 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-23 21:53:45 +00:00
Chris Lattner
d1ff35a49d Emit code that matches the incoming DAG pattern and checks predicates.
This does not check that types match yet, but PPC only has one integer type
;-).

This also doesn't have the code to build the resultant dag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23414 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-23 21:33:23 +00:00
Chris Lattner
3f7e91477e emit information about the order patterns are to be matched.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23413 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-23 20:52:47 +00:00
Chris Lattner
813033248c start filling in the switch stmt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23412 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-23 19:36:15 +00:00
Chris Lattner
b9f01eb7bc Fix a minor bug, add comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23370 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-16 00:29:46 +00:00
Chris Lattner
a28aec1da7 teach the type inference code how to infer types for instructions and node
xforms.  Run type inference on result patterns, so we always have fully typed
results (and to catch errors in .td files).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23369 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-15 22:23:50 +00:00
Chris Lattner
ae5b350b3b put instructions into a map instead of a vector for quick lookup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23368 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-15 21:57:35 +00:00
Chris Lattner
ae6d828de8 when parsing instructions remember information about the types taken and
returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23367 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-15 21:51:12 +00:00
Chris Lattner
abbb605d80 Start parsing "Pattern" nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23365 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-15 21:42:00 +00:00
Chris Lattner
b39e4be1e1 rename a couple of methods, add structure for pattern parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23364 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-15 02:38:02 +00:00
Chris Lattner
f1311843d5 Verify that xform functions only occur in logical places
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23363 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 23:05:13 +00:00
Chris Lattner
2175c18c4f Promote xform fns to be explicit nodes in result patterns, and clean off
predicates since they will have already matched at this point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23362 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 23:01:59 +00:00
Chris Lattner
b0276200e6 start building the instruction dest pattern correctly. Change the xform
functions to preserve the Record for the xform instead of making it into a
function name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23361 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 22:55:26 +00:00
Chris Lattner
7da852fbab catch unnamed inputs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23360 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 22:06:36 +00:00
Chris Lattner
0b59225fe1 check that there are no unexpected operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23359 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 21:59:34 +00:00
Chris Lattner
c4a8b73ab3 force all instruction operands to be named.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23358 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 21:13:50 +00:00
Chris Lattner
5d7d3dba9c Check that operands have unique names. REJECT instructions with broken operand
lists: only don't parse them if they are entirely missing (sparcv9).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23355 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 21:05:02 +00:00
Chris Lattner
3a7319d5ed fix a broke range check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23354 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 21:04:12 +00:00
Chris Lattner
d8a3bde6fd Parse significantly more of the instruction pattern, now collecting and
verifying information about the operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23353 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 20:53:42 +00:00
Chris Lattner
39e8af9913 Verify that set destinations occur first in the instruction operand list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23351 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 18:19:25 +00:00
Chris Lattner
a974b20cae add an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23349 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 18:02:53 +00:00
Chris Lattner
71cdb7fc7a remove some code that isn't ready for prime time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23346 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 06:03:10 +00:00
Chris Lattner
ec67643e86 Switch to a slightly more structured representation for instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23345 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 04:03:16 +00:00
Chris Lattner
5f8cb2a28a Add some more checking/verification code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23344 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 02:11:12 +00:00