Commit Graph

325 Commits

Author SHA1 Message Date
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
Chris Lattner
e3cbf823f0 spell this right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23099 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:55:40 +00:00
Chris Lattner
5f89bf0f9d spell this variable right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23095 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:42:52 +00:00
Chris Lattner
8b50f9b8dc Expose a new flag to TargetInstrInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23094 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:40:46 +00:00
Chris Lattner
9fdd6e3f50 add a marker at the end of the instruction enum list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23090 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:17:00 +00:00
Chris Lattner
8d30c23d26 Emit this:
static const TargetOperandInfo OperandInfo6[] = { { &PPC32::CRRCRegClass }, { 0 }, };

instead of this:

static const TargetOperandInfo OperandInfo6[] = { { PPC32::CRRCRegisterClass }, { 0 }, };

For operand information, which does not require dynamic (startup-time)
initialization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22931 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 20:29:14 +00:00
Chris Lattner
60200e5d32 Expose the derived register classes to the public header, allowing them
to be accessed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22930 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 20:23:42 +00:00
Chris Lattner
ac46893e24 Split register class "Methods" into MethodProtos and MethodBodies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22928 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 19:12:51 +00:00
Chris Lattner
42de581b2f Refactor to use Target.getRegisterClasses consistently, which provides
anonymous regclass definition renaming.

Change the generated code to emit register classes as properly namespace
qualified entities like everything else.

expose the actual class definition as an object, though this isn't quite
usable yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22920 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 18:47:59 +00:00
Chris Lattner
d5aa3e26bb Emit real operand info for instructions. This currently works but is bad
in one way: the generated tables require dynamic initialization for the
register classes.  This will be fixed in a future patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22919 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 18:46:26 +00:00
Chris Lattner
c67c18fd23 Read the namespace field from register classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22918 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 18:45:20 +00:00
Chris Lattner
22c6202bb3 add a setName method to record
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22912 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 17:58:49 +00:00
Chris Lattner
936dd9274a Add a setName method to Record.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22911 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 17:58:11 +00:00
Chris Lattner
0e384b66a7 For now, just emit empty operand info structures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22910 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 16:57:28 +00:00
Chris Lattner
bfd4f55202 Fix a problem jeffc noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22903 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 06:16:04 +00:00
Chris Lattner
fcd60a010b The code emitter generator only supports targets with 32-bit instruction
words.  There is no way for one of these targets to have a > 32-bit immediate!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22897 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 01:04:33 +00:00
Chris Lattner
d98958f4bd now that all of the targets are clean w.r.t. the number of operands for each
instruction defined, actually emit this to the InstrInfoDescriptor, which
allows an assert in the machineinstrbuilder to do some checking for us,
and is required by the dag->dag emitter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22895 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-19 00:59:49 +00:00
Chris Lattner
cfbf96aa9c Figure out how many operands each instruction has, keep track of whether
or not it's variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22885 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-18 23:38:41 +00:00
Chris Lattner
f372ae6ebc revert this change, which causes breakage, temporarily
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22880 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-18 22:12:31 +00:00
Chris Lattner
a3ac88d8ab When emitting implicit use/def lists, only emit each unique list once. Though
LLVM is able to merge identical static const globals, GCC isn't, and this caused
some bloat in the generated data.  This has a marginal effect on PPC, shrinking
the implicit sets from 10->4, but shrinks X86 from 179 to 23, a much bigger
reduction.

This should speed up the register allocator as well by reducing the dcache
footprint for this static data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22879 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-18 21:36:47 +00:00
Chris Lattner
dcfa353d74 Fill in the numOperands field of the TargetInstrDescriptor struct from the
.td file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22873 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-18 19:45:37 +00:00
Jeff Cohen
00b16889ab Eliminate all remaining tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:12:32 +00:00
Chris Lattner
3e3def9c19 Fix PR595: These error messages should not be looking at CGI.Name, they
should be looking at CGI.TheDef->getName().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22445 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-15 22:43:04 +00:00