Commit Graph

659 Commits

Author SHA1 Message Date
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
Chris Lattner
1f39e2910b start parsing instructions into patterns, start doing many more checks of
'set's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23343 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-14 00:09:24 +00:00
Chris Lattner
f4f33ba518 don't emit the namespace inside the class!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23341 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-13 22:05:02 +00:00
Chris Lattner
1048b7a67e Emit code suitable for emission into the ISel class, allowing us to use/define
methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23340 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-13 22:03:37 +00:00
Chris Lattner
6de8b53230 continue xform function parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23338 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-13 21:59:15 +00:00
Chris Lattner
24eeeb8c3e Start parsing node transformation information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23337 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-13 21:51:00 +00:00
Chris Lattner
8f493130bb Add a new Record::getValueAsCode method to mirror the other getValueAs*
methods.  Use it to simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23336 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-13 21:44:28 +00:00
Chris Lattner
ee9f0c3c2e completely eliminate TreePattern::PatternType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23335 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-13 21:20:49 +00:00
Chris Lattner
2b931e8035 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23311 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-12 05:30:06 +00:00
Chris Lattner
2fc4f120c6 Rearrange two rules, which apparently makes some versions of bison happier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23310 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-12 05:29:43 +00:00
Jeff Cohen
8337b0797b Fix miscellaneous Visual Studio build problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23307 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-10 02:00:02 +00:00
Chris Lattner
3793709e89 add an accessor to provide more checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23289 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-09 01:15:01 +00:00
Chris Lattner
f2a17a70f4 use new accessors to simplify code. Add checking to make sure top-level instr
definitions are void


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23288 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-09 01:11:44 +00:00
Chris Lattner
2018005096 add some accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23287 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-09 01:11:17 +00:00
Chris Lattner
95f6b76817 Fix incorrect comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23285 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 23:26:30 +00:00
Chris Lattner
327076005d Implement a complete type inference system for dag patterns, based on the
constraints defined in the DAG node definitions in the .td files.  This
allows us to infer (and check!) the types for all nodes in the current
ppc .td file.  For example, instead of:

Inst pattern EQV:       (set GPRC:i32:$rT, (xor (xor GPRC:i32:$rA, GPRC:i32:$rB), (imm)<<Predicate_immAllOnes>>))

we now fully infer:

Inst pattern EQV:       (set:void GPRC:i32:$rT, (xor:i32 (xor:i32 GPRC:i32:$rA, GPRC:i32:$rB), (imm:i32)<<Predicate_immAllOnes>>))

from:  (set GPRC:$rT, (not (xor GPRC:$rA, GPRC:$rB)))


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23284 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 23:22:48 +00:00
Chris Lattner
e9f4ba8dd4 Compute the value types that are natively supported by a target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23282 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 21:43:21 +00:00
Chris Lattner
33c92e9296 Parse information about type constraints on SDNodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23281 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 21:27:15 +00:00
Chris Lattner
6af14a629d use node info in the one place we currently use it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23280 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 21:04:46 +00:00
Chris Lattner
ca559d0654 start parsing SDNode info records
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23279 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 21:03:01 +00:00
Chris Lattner
751eabf7bd Fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23276 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 19:47:28 +00:00
Chris Lattner
ca572be3a1 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23275 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 18:48:47 +00:00
Chris Lattner
a1207a5add Add support for automatically created anonymous definitions.
This implements Regression/TableGen/AnonDefinitionOnDemand.td


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23274 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 18:48:23 +00:00
Chris Lattner
ba4b144764 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23271 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 18:22:57 +00:00
Chris Lattner
69b545e877 Tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23270 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 18:22:35 +00:00
Chris Lattner
fbf8e57639 Keep names even when inlining. This allows us to realize that ADDI is:
(set GPRC:i32:$rD, (add GPRC:i32:$rA, (imm)<<Predicate_immSExt16>>:$imm))

not:

(set GPRC:i32:$rD, (add GPRC:i32:$rA, (imm)<<Predicate_immSExt16>>))

(we keep the ":$imm")


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23269 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-08 17:45:12 +00:00
Chris Lattner
54cb8fd814 Initial cut of the dag isel generator. This is still very much a work in
progress.  It correctly parses instructions and pattern fragments and glues
together pattern fragments into instructions.

The only code it generates currently is some boilerplate code for things
like the EntryNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23261 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-07 23:44:43 +00:00
Chris Lattner
6b5d9cdfcf Rename a class. These files are being migrated to the new isel and I want to
reuse the names


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23252 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-06 22:51:34 +00:00
Chris Lattner
46a780056b regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23249 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-06 21:23:27 +00:00
Chris Lattner
9978332473 Tighten up the specification to allow TableGen/nested-comment.td to pass
(fixing a bug where / in a /* */ comment would cause it to not close).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23248 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-06 21:23:09 +00:00
Chris Lattner
4a24c645c8 Add an option and stuff implementation of a dag isel emitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23236 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-03 01:14:03 +00:00
Reid Spencer
68a24bdba4 Implement PR614:
These changes modify the makefiles so that the output of flex and bison are
placed in the SRC directory, not the OBJ directory. It is intended that they
be checked in as any other LLVM source so that platforms without convenient
access to flex/bison can be compiled. From now on, if you change a .y or
.l file you *must* also commit the generated .cpp and .h files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23115 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 18:50:39 +00:00