Commit Graph

276 Commits

Author SHA1 Message Date
Chris Lattner 254980008b Add full support for code generating expanders!
This includes support for referencing named arguments.

llvm-svn: 7715
2003-08-10 23:51:52 +00:00
Chris Lattner 1bce0f268b Implement autopromotion of leaf trees from arguments to nodes of their own,
making it easier to write patterns without lots of extraneous parens

llvm-svn: 7714
2003-08-10 22:38:36 +00:00
Chris Lattner 3859c9a8db Implement correct parsing, representation, and printing of DAG argument names
Implements testcase TableGen/TreeNames.td

llvm-svn: 7713
2003-08-10 22:14:13 +00:00
Chris Lattner 4eaf72fc3b Recognize $foo as a variable
llvm-svn: 7712
2003-08-10 22:04:25 +00:00
Chris Lattner 5223d51aac Implement real code emission, at least for Instruction patterns,
next up: support for expanders

llvm-svn: 7710
2003-08-10 21:54:43 +00:00
Chris Lattner 0e00f36924 First cut at emitting the reducer. This reducer just prints out the patterns
selected, but it seems to work great!

llvm-svn: 7709
2003-08-10 20:34:13 +00:00
Chris Lattner d2ec0bd8f0 Finish the matcher!
llvm-svn: 7707
2003-08-10 19:50:51 +00:00
Chris Lattner 12a19fda99 Add new function
llvm-svn: 7706
2003-08-10 19:50:32 +00:00
Chris Lattner 575288e02d This implements a large amount of the matcher, in fact, all of it except for one bug
llvm-svn: 7702
2003-08-08 22:29:23 +00:00
Chris Lattner 1ac45ba538 Emit the first half of the instruction selector.
llvm-svn: 7701
2003-08-08 16:30:10 +00:00
Chris Lattner 4d8ba42bc4 Finish implementation of nonterminal instantiation.
Tree patterns are now, finally, ready to use!

llvm-svn: 7699
2003-08-07 23:16:20 +00:00
Chris Lattner fe64759b2c Add new method to get a value type as a string
llvm-svn: 7698
2003-08-07 23:15:21 +00:00
Misha Brukman c231c0889e close() requires "unistd.h" .
llvm-svn: 7695
2003-08-07 21:35:41 +00:00
Misha Brukman e4d58ec261 Doxygen-ify the comments by using '///' instead of '//'.
llvm-svn: 7694
2003-08-07 21:34:25 +00:00
Misha Brukman b02e413f65 Remove references to `bugpoint' from the now-generic system utilities.
llvm-svn: 7693
2003-08-07 21:33:33 +00:00
Misha Brukman 3581f8542d Moved removeFile() and getUniqueFilename() into FileUtilities.
llvm-svn: 7691
2003-08-07 21:28:50 +00:00
Chris Lattner 19630d41f8 Implement type-inference/checking for non-terminal references
llvm-svn: 7686
2003-08-07 21:02:56 +00:00
Chris Lattner acf3dbe0c5 Rename all of the "Process" methods to be "read" methods, start the Instantiate method
llvm-svn: 7685
2003-08-07 20:42:23 +00:00
Chris Lattner ca89a11494 Add support for "cast" nodes, which are required when there is not enough information
to infer type type of all nodes, e.g. (ret imm)

llvm-svn: 7684
2003-08-07 19:59:42 +00:00
Chris Lattner bd1ffb4ea1 Use the new version of isSubClassOf
llvm-svn: 7683
2003-08-07 19:42:14 +00:00
Chris Lattner c6793425e3 Add and use a new method
llvm-svn: 7682
2003-08-07 19:41:59 +00:00
Chris Lattner 9b759739ef Cleanup and reorganize code, no functional changes
llvm-svn: 7679
2003-08-07 19:28:55 +00:00
Chris Lattner b6629063ec Read in expanders too
llvm-svn: 7678
2003-08-07 19:21:10 +00:00
Chris Lattner a63e04482f Continued evolution of the selector emitter: Represent instruction patterns
as first class objects

llvm-svn: 7677
2003-08-07 19:12:24 +00:00
Chris Lattner ccb9f8ed54 Finish implementation of the type inference engine.
Start working on reading in nonterminals

llvm-svn: 7671
2003-08-07 06:02:15 +00:00
Chris Lattner da2e1dcc2b Allow clients to get at the pointer type
llvm-svn: 7670
2003-08-07 06:01:44 +00:00
Chris Lattner 32809aad34 Add new method getVAlueAsDag
llvm-svn: 7669
2003-08-07 06:00:43 +00:00
Chris Lattner c01182c716 Initial checkin of tree pattern parser and type inference engine (which still needs work).
llvm-svn: 7668
2003-08-07 05:40:14 +00:00
Chris Lattner 40842f4c8b Eliminate now-dead method
llvm-svn: 7667
2003-08-07 05:39:37 +00:00
Chris Lattner 377f096678 Start using the CodeGeneratorWrappers
llvm-svn: 7666
2003-08-07 05:39:09 +00:00
Chris Lattner 9f993091ea Initial checkin of useful wrappers around the Target classes, for now, only ValueType and
Target are wrapped

llvm-svn: 7665
2003-08-07 05:38:11 +00:00
Chris Lattner e76a2e790d Ick, add the RIGHT accessor
llvm-svn: 7656
2003-08-06 23:01:18 +00:00
Chris Lattner 116ad79efd Add accessor
llvm-svn: 7655
2003-08-06 23:00:31 +00:00
Chris Lattner 4438d571f2 There is something wrong with code that looks like:
if (R == 0 || ...)
  R->getName()

llvm-svn: 7654
2003-08-06 22:29:04 +00:00
Chris Lattner 48b78c8bf3 Export the register classes so that the instruction selector can get at them as needed
llvm-svn: 7651
2003-08-06 21:47:14 +00:00
Misha Brukman 31b31d94d9 Added asserts to prevent negative shift amounts from being generated.
llvm-svn: 7640
2003-08-06 16:28:49 +00:00
Chris Lattner f0f55a9b28 Add error checking code to the node type parser. Start the instruction pattern
reader

llvm-svn: 7632
2003-08-06 06:16:35 +00:00
Chris Lattner b5035a4ec9 Initial support for an instruction selector emitter
llvm-svn: 7631
2003-08-06 05:42:05 +00:00
Chris Lattner 236ced1487 All good classes with virtual functions should have virtual dtors...
llvm-svn: 7630
2003-08-06 05:39:03 +00:00
Chris Lattner bb43caeb95 Add an instruction selector emitter skeleton
llvm-svn: 7629
2003-08-06 04:47:56 +00:00
Chris Lattner 36498143ba convert over to using TableGen backends
llvm-svn: 7628
2003-08-06 04:36:35 +00:00
Chris Lattner 7179feb5e2 Switch code over to being a TableGenBackend
llvm-svn: 7627
2003-08-06 04:32:07 +00:00
Chris Lattner 4708d5ce31 Add more helper methods
llvm-svn: 7626
2003-08-06 04:31:26 +00:00
Chris Lattner 5f2e204a46 New common interface for backends to use
llvm-svn: 7625
2003-08-06 04:23:04 +00:00
Misha Brukman 790a6f5e6c Stop special-casing annul and predict bits (which are Sparc-specific anyway)
since those bits are now hard-coded in Sparc*.td files.

llvm-svn: 7593
2003-08-05 14:35:35 +00:00
Chris Lattner 9c9b4c54fa No functional changes, comment the fix I just put in
llvm-svn: 7590
2003-08-05 03:59:01 +00:00
Chris Lattner 01349f463c The CodeEmitterGenerator used to consider ANY uninitialized field as being an
operand (unless it's annul or predict).  Now we only consider fields to be
operands if they are uninitialized AND used in the "Inst" field.

llvm-svn: 7589
2003-08-05 03:53:04 +00:00
Chris Lattner ad9e792bef Parse DAG patterns
llvm-svn: 7577
2003-08-04 20:44:43 +00:00
Chris Lattner 828052eb2d add support for DagInit initializers, which represent DAG patterns
llvm-svn: 7576
2003-08-04 20:44:17 +00:00
Chris Lattner 9d37429cfe Update file header comment
llvm-svn: 7574
2003-08-04 20:08:28 +00:00