Commit Graph

20004 Commits

Author SHA1 Message Date
Chris Lattner 91d8672be1 add some accessors
llvm-svn: 23287
2005-09-09 01:11:17 +00:00
Chris Lattner 39b4d83f6a Introduce two new concepts:
1. Add support for defining Pattern's, which can match expressions when there
   is no instruction that directly implements something.  Instructions usually
   implicitly define patterns.
2. Add support for defining SDNodeXForm's, which are node transformations.
   This seperates the concept of a node xform out from the existing predicate
   support.

Using this new stuff, we add a few instruction patterns, one for testing, and
two for OR/XOR by an arbitrary immediate.

llvm-svn: 23286
2005-09-09 00:39:56 +00:00
Chris Lattner debd6e95ab Fix incorrect comment
llvm-svn: 23285
2005-09-08 23:26:30 +00:00
Chris Lattner d7d31f3b06 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)))
llvm-svn: 23284
2005-09-08 23:22:48 +00:00
Chris Lattner 4b09f3c6f5 whitespace/comment changes, no functionality diffs
llvm-svn: 23283
2005-09-08 23:17:26 +00:00
Chris Lattner cee994b464 Compute the value types that are natively supported by a target.
llvm-svn: 23282
2005-09-08 21:43:21 +00:00
Chris Lattner 1c33104010 Parse information about type constraints on SDNodes
llvm-svn: 23281
2005-09-08 21:27:15 +00:00
Chris Lattner a3b89dfcef use node info in the one place we currently use it
llvm-svn: 23280
2005-09-08 21:04:46 +00:00
Chris Lattner 35bcd1488a start parsing SDNode info records
llvm-svn: 23279
2005-09-08 21:03:01 +00:00
Nate Begeman 85c1cc4523 Move yet more folds over to the dag combiner from sd.cpp
llvm-svn: 23278
2005-09-08 20:18:10 +00:00
Chris Lattner 0ec8fa0880 Add a bunch of stuff needed for node type inference. Move 'BLR' down with
the rest of the instructions, add comment markers to seperate portions of
the file into logical parts

llvm-svn: 23277
2005-09-08 19:50:41 +00:00
Chris Lattner 07f1e4597e Fix indentation
llvm-svn: 23276
2005-09-08 19:47:28 +00:00
Chris Lattner bd6b164965 regenerate
llvm-svn: 23275
2005-09-08 18:48:47 +00:00
Chris Lattner 972cccd77a Add support for automatically created anonymous definitions.
This implements Regression/TableGen/AnonDefinitionOnDemand.td

llvm-svn: 23274
2005-09-08 18:48:23 +00:00
Chris Lattner 1872ea3227 x and X should be structurally identical
llvm-svn: 23273
2005-09-08 18:47:43 +00:00
Chris Lattner 808c642e62 new expression type
llvm-svn: 23272
2005-09-08 18:47:21 +00:00
Chris Lattner 5a699e621f regenerate
llvm-svn: 23271
2005-09-08 18:22:57 +00:00
Chris Lattner 8a41b214b3 Tabs to spaces.
llvm-svn: 23270
2005-09-08 18:22:35 +00:00
Chris Lattner 399f59f643 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")

llvm-svn: 23269
2005-09-08 17:45:12 +00:00
Chris Lattner 76cb006e2c add patterns for x?oris?
llvm-svn: 23268
2005-09-08 17:40:49 +00:00
Chris Lattner 2d8032b54c add patterns to the addi/addis/mulli etc instructions. Define predicates
for matching signed 16-bit and shifted 16-bit ppc immediates

llvm-svn: 23267
2005-09-08 17:33:10 +00:00
Chris Lattner cf9b0e6673 Add patterns for some new instructions, allowing the use of the ineg fragment.
llvm-svn: 23266
2005-09-08 17:01:54 +00:00
Chris Lattner f18935a598 add some missing PPC backend files
llvm-svn: 23265
2005-09-07 23:57:00 +00:00
Chris Lattner a0d936cdc5 Add tblgen fpcmp and the nightly tester to the utils folder
llvm-svn: 23264
2005-09-07 23:53:49 +00:00
Chris Lattner 7c8dba750c ignore generated files
llvm-svn: 23263
2005-09-07 23:47:44 +00:00
Chris Lattner 498915dafa Remove some cases handled by the generated portion of the isel
llvm-svn: 23262
2005-09-07 23:45:15 +00:00
Chris Lattner d2a5b366f5 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.

llvm-svn: 23261
2005-09-07 23:44:43 +00:00
Nate Begeman 2cc2c9a79c Another round of dag combiner changes. This fixes some missing XOR folds
as well as fixing how we replace old values with new values.

llvm-svn: 23260
2005-09-07 23:25:52 +00:00
Chris Lattner 5d16dbd5bb Fix a bug that Tzu-Chien Chiu noticed: live interval analysis does NOT
preserve livevar

llvm-svn: 23259
2005-09-07 17:34:39 +00:00
Nate Begeman 6791d63e55 Implement a common missing fold, (add (add x, c1), c2) -> (add x, c1+c2).
This restores all of stanford to being identical with and without the dag
combiner with the add folding turned off in sd.cpp.

llvm-svn: 23258
2005-09-07 16:09:19 +00:00
Chris Lattner 5ea0ee7b19 On non-apple systems, when using -march=ppc32, do not print:
'' is not a recognized processor for this target (ignoring processor)

Default to "generic" instead of "" for the default CPU.

llvm-svn: 23257
2005-09-07 05:45:33 +00:00
Chris Lattner 8d0e9d90aa Print:
'' is not a recognized processor for this target (ignoring processor)

instead of:

 is not a recognized processor for this target (ignoring processor)

llvm-svn: 23256
2005-09-07 05:44:14 +00:00
Chris Lattner fe883adfd2 Fix a bug nate ran into with replacealluseswith. In the recursive cse case,
we were losing a node, causing an assertion to fail.  Now we eagerly delete
discovered CSE's, and provide an optional vector to keep track of these
discovered equivalences.

llvm-svn: 23255
2005-09-07 05:37:01 +00:00
Chris Lattner 3852fd0e49 Add a new argument to ReplaceAllUsesWith to keep track of nodes deleted by
this method

llvm-svn: 23254
2005-09-07 05:36:18 +00:00
Nate Begeman 007c650699 Add an option to the DAG Combiner to enable it for beta runs, and turn on
that option for PowerPC's beta.

llvm-svn: 23253
2005-09-07 00:15:36 +00:00
Chris Lattner c59a1dbce2 Rename a class. These files are being migrated to the new isel and I want to
reuse the names

llvm-svn: 23252
2005-09-06 22:51:34 +00:00
Nate Begeman a53a310d8c Test the new 64bit i64<->fp functionality
llvm-svn: 23251
2005-09-06 22:23:15 +00:00
Nate Begeman 6095214bf0 Implement i64<->fp using the fctidz/fcfid instructions on PowerPC when we
are allowed to generate 64-bit-only PowerPC instructions for 32 bit hosts,
such as the PowerPC 970.

This speeds up 189.lucas from 81.99 to 32.64 seconds.

llvm-svn: 23250
2005-09-06 22:03:27 +00:00
Chris Lattner 784e44443d regenerate
llvm-svn: 23249
2005-09-06 21:23:27 +00:00
Chris Lattner ab9eba1014 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).

llvm-svn: 23248
2005-09-06 21:23:09 +00:00
Chris Lattner 23e2499ee4 new testcase: tblgen should grok this.
llvm-svn: 23247
2005-09-06 21:22:15 +00:00
Andrew Lenharth a63a066205 Fix up the AssertXext problem, as well as adding it at calls
llvm-svn: 23246
2005-09-06 17:00:23 +00:00
Nate Begeman e9e2c6d314 Add note about future optimization noted in the ppc compiler writer's guide
llvm-svn: 23245
2005-09-06 15:30:48 +00:00
Nate Begeman 2dded8302a Add accessor for 64bit flag, so that we can tell when it is safe to
generate the fun in-register fp<->long instructions.

llvm-svn: 23244
2005-09-06 15:30:12 +00:00
Nate Begeman d23739d020 Next round of DAGCombiner changes. This version now passes all the tests
I have run so far when run before Legalize.  It still needs to pick up the
SetCC folds, and nodes that use SetCC.

llvm-svn: 23243
2005-09-06 04:43:02 +00:00
Chris Lattner f1705fdda4 Add a requirement, patch contributed by Henrik Bach.
llvm-svn: 23242
2005-09-06 04:07:15 +00:00
Andrew Lenharth c8bd5bda59 revert part of the last change, should fix regressions
llvm-svn: 23241
2005-09-04 06:12:19 +00:00
Chris Lattner aa833d4571 explicitly specify an operands list for patterns with inputs (e.g. neg)
llvm-svn: 23240
2005-09-03 01:28:40 +00:00
Chris Lattner 8ae9525bd0 include the dag isel fragment
llvm-svn: 23239
2005-09-03 01:17:22 +00:00
Chris Lattner 0442dcfabc ask for a dag isel
llvm-svn: 23238
2005-09-03 01:15:41 +00:00