Bill Currie
c5f2e3c4ad
Make dag dumping from gdb easier.
2012-11-21 15:03:44 +09:00
Bill Currie
bedde02307
Make flow graphs with dags easier to read.
...
The node contents are now the dag rather than the dag being attached to the
node.
2012-11-21 13:43:03 +09:00
Bill Currie
0c3aeb30aa
Reuse tempary variables.
...
Now that I've got nice code, it was worth doing. Unfortunatly, bsearch
style switch statements have problems.
switch.r:14: BUG: temp users went negative: <tmp 0x21b6840:-1>
switch.r:14: BUG: temp users went negative: <tmp 0x21b6840:-2>
switch.r:14: BUG: temp users went negative: <tmp 0x21b6840:-3>
switch.r:14: BUG: temp users went negative: <tmp 0x21b67d0:-1>
2012-11-18 19:10:18 +09:00
Bill Currie
8fe71f2146
Display a dagnode's extra dependency edges.
2012-11-18 12:55:44 +09:00
Bill Currie
d3f010a81b
Fix the flow-dag connections in the flow graphs.
2012-11-18 11:34:01 +09:00
Bill Currie
af4e56bba8
Topologically sort the dag.
...
It doesn't make any difference yet, but that's because I need to add extra
edges indicating iter-node dependencies. However, the sort does seem to
work for its limited input.
2012-11-18 09:23:01 +09:00
Bill Currie
12133bc02f
Rewrite dags to use sets.
...
While things are quite broken now (very incorrect code is being generated),
the dag is much easier to work with. The dag is now stored in an array of
nodes (the children pointers are still used for dagnode operands), and sets
are used for marking node parents, attached identifiers and (when done,
extra edges).
2012-11-17 21:14:42 +09:00
Bill Currie
43d77900d5
Rewrite dag_gencode to use statement/node types.
...
It now seems to generate correct code for each node. However, node order is
still incorrect in places (foo++ is being generated as ++foo). quattest.r
actually executes and produces the right output :)
2012-11-16 22:09:49 +09:00
Bill Currie
c1776fc2ad
Make the dags in flow graphs a little easier to read.
2012-11-16 12:42:57 +09:00
Bill Currie
783b4082a1
Produce tidier dag dumps.
2012-11-15 13:44:08 +09:00
Bill Currie
dc9d2a982e
Make the returned dag a linked list of root-nodes.
...
A dag can have mulitple "root" nodes (ie, nodes with no parents).
2012-11-15 13:44:06 +09:00
Bill Currie
c57df8b5f3
Print all dag nodes in a dag.
...
Dags can have multiple roots, so only recursing once could miss much of the
dag.
2012-11-15 13:44:06 +09:00
Bill Currie
dbf1aa8f72
Attach dags to statement blocks.
...
Now, if a dag is attached to a statement block, it will be included in the
flowgraph with that statement block.
2012-11-15 13:44:06 +09:00
Bill Currie
24553867a4
Use dashed lines for attached identifiers in dags.
2012-11-15 13:44:06 +09:00
Bill Currie
d9354255a3
Avoid double-printing dag nodes.
2012-11-15 13:44:05 +09:00
Bill Currie
b7b6294d87
Fix some dag printing goofs.
...
Typo and no node recursion.
2012-11-15 13:44:05 +09:00
Bill Currie
60108c688c
Change dags from binary to trinary.
...
I'd forgotten some instructions take three inputs that can benefit from
CSE.
2012-11-15 13:44:05 +09:00
Bill Currie
0fefeb73fe
Initial support for basic block dags.
...
Currently, only dumping to dot, but that seems to be a very sensible place
to start: debug support.
2012-11-15 13:44:05 +09:00