*** empty log message ***
[libfirm] / TODO
1   14.3.2001 Boris
2   - make dist should create an archive which has the directory libfirm/
3     as top-level [DONE:28.3.2001 Boris]
4   - Datei 'Copyright' oder 'Copying' mit entsprechendem Copyrightverweis
5
6 *********** old stuff ***********
7
8
9  * Problem mit endlosen Schleifen loesen.
10
11  + if_while_example ergibt Segmentation Fault da Bad Vorgaenger von Endblock.
12    Optimierung des end blocks geaendert.
13
14  * Automatisches generieren und set_value der Argumente-projs in
15    new_ir_graph
16
17  * Define and implement procedure-global extensions, e.g., the call graph.
18
19  * Implement Confirm node: Added by optimization to annotate dataflow
20    edge with information as (value > 0).  This improves dataflow analysis.
21    These nodes can be derived from Cmp nodes in conjunction with dataflow
22    information.
23
24  * think again about implementation of boolean expressions  (0<1) && (2<3)
25
26  * Adapt tv to operate on the new modes, adapt libfirm, e.g., remove
27    strange constructors.
28
29  * define Nodes for Rotate, Not, Minus, ShrA (Done.)
30    Add evaluation routines to target value, extend optimization,
31    verification to cover these nodes, extend irdump to cover them.
32
33  * do we need remainder (Rem) operator?
34    different sign handling than Mod.  How much processors???
35
36  * Turn Quot, Minus into three letter operator.
37
38 Propositions by Boris, 5.3.2001:
39  + Fehler in FIRM?
40    ---------------
41    + in oo_program_example ist das Feld einfach nur eine entity. Aber alles andere
42      hat einen bestimmten Typ (z.B. method, strct, etc.). Muß es dann nicht auch
43      field geben? Oder werden alle Felder eines Objekts in einem strct organisiert
44      -> HowTo Use FIRM - Doku.
45      ==> Wann eine entitaet ein Feld ist, laesst sich am Typ der Entitaet enkennen.
46          Entitaet ist Feld wenn Owner Klassentyp (oder ev. Struct) und Typ nicht
47          Methodentyp.
48          Speicherbedarf der Entitaet, d.h. ihr mode, laesst sich auch dem Typ ansehen.
49          Manche Typen enthalten explizit den mode (z.B. type_primitive, type_pointer.)
50          Bei anderen haengt die Groesse vom Layout ab:  class, struct.
51          Frage (fehlende Konvention): Ist eine Klasse ein Pointer oder immer nur
52          eine Value-Class??  Je nach dem muss man die Entitaeten modellieren:
53          Klasse = Pointer:  entitaet kann Typ=class haben.
54          Klasse = WerteKlasse: entitaet sollte pointer mit points-to Klasse sein.
55    - fehlende Optimierung: wenn ein Wert einer Ladeoperation nicht gebraucht wird,
56      dann gibt es auch keine Kante dafuer, aber die Ladeoperation bleibt
57      (unnoetigerweise) stehen.
58    - mit set_optimize(1) geht die Optimierung von if(const cmpop const) unvollständig
59      bzw. falsch [da bleibt wohl ein zweiter Block-Knoten ohne Vorgänger]
60  + Verbesserungsvorschläge:
61    ------------------------
62    + Knoten im Typgraphen mit Farbe hinterlegen
63    - Attribute im Firmgraphen nicht im Knoten
64    + Kanten je nach Sematik farbig markieren, vielleicht dann auch Knoten
65      (z.B. rot fuer alles, was mit Steuerfluss zu tun hat)
66    + konfigurierbar, ob Konstanten im Startblock, oder im aktuellen
67      ==> geht schlecht.
68    + von Hochsprachtypen loesen? Signed32 statt int?
69      ==> viel Arbeit, nur Namenskonvention.  Ev wenn target value modul
70          ausgetauscht.
71
72  + change impelmentation of type to use concept as in irnode.
73    Three common fields: kind, ident, mode !!! fill mode with
74    mode_none if applicable.
75
76  + add asserts in type.c that check that proper type is passed.
77    not in get_type_name, get_type_ident.
78
79  + type / entity not good, too much casts.
80    merge type_or_ent union with type union. ??!!
81    allocate always unions.
82    write access routines for type, e.g. get_type_name.
83    change access routines for individual types to select from union.
84
85  + Wann macht man Dispatch Tabellen.  Lower Phase
86
87  + integrate irgmod into ircons.  The routines in there are only needed
88    during ir construction.  (If there are some not needed, remove them.)
89
90  + Build more structured directoriy structure:
91    ir/ir                irgraph, irnode, irop, irmode, type, entity,
92                         common,
93    ir/manipulate        ircons, irgmod, irvrfy
94    ir/optimize          iropt, irflag
95    ir/datastructure     array, obst, pdeq, pset, set
96    ir/include           gmp, host, xfprintf, xgprintf, xmalloc,
97                         xoprintf, xp_help, xprintf
98    ir/compilermodules   ident, xx_ident, tv, ieee754
99    ir/aux               irdump, strerror,
100    where goes           debug, firm, label, mangle, misc, panic, tune?
101
102  + Changes to nodes:
103    - SymConst also returns pointer.
104    - Start returns pointer to segment for globals.
105    - remove copy, clear, type_or_ent
106    - add free
107    - add constructor for shrs
108    - remove Phi0 ruins
109
110  + How shall global variables be modeled in FIRM, if programs as C are
111    translated?  Modeling them as entity of the class defined for the
112    file/compilation unit is not sufficient, as then they are not
113    visible from out of this file.
114    For the uebprakt and kirmes we model them by selection from the
115    area that contains all globals (data segment).  The pointer to
116    this area is provided by the start node.
117    In Sather these were modeled by pointers to string constants containing
118    the name of the global variable (or static field):
119      new_Const (mode_p, tarval_p_from_str ("VAR_A"))
120
121  + port transform_node in iropt to lib.
122
123  + make new Version
124
125 ***************************************************************************
126
127  + add attributes from doku to constructors.
128
129  + add Phi_in stack as field to ir_graph??!!
130
131  + implement ShrA constructor.
132    What are allowed types?
133
134  + add type struct
135
136  + write dumper for type information.
137    write dumper for type and graph.
138    write dumper for control flow graph.
139
140  + dump irgraph with all the type information.  Write function that
141    dumps type information and one that dumps entities.  To integrate
142    this separate dump_node and the recursion, and add the dump_type
143    and dump_entity function in the recursive iterator or write second
144    dump routine.
145
146  + Fix bug in pset/set, so that several tables can be used. iropt/identify
147    aborts. Thanks, Boris!
148
149  + write example program with irreducible control flow:
150
151    /* Phi node with three predecessors: */
152       a = 1
153       if () goto loop
154       a = 2
155       goto loop
156    loop:
157       if () goto exit
158       b = 1
159       goto loop
160    exit:
161       b = a
162
163    /* irreducible two entry loop */
164       b = 1
165       if () goto entry1 else goto entry2
166    entry 1
167       a = 2
168       if () goto exit else goto entry 2
169    entry 2
170       a = 1
171       if () goto exit else goto entry 1
172    exit
173       b = a + b
174
175  + entity must be able to take arrays as owner.  Anything else?
176    --> assert allowed types.
177
178  + Alloc must be able to take any type as owner.  Also primitive types
179    so that allocation to the stack of dereferenced local variables can
180    be modeled.
181
182  + Implement vrfy_graph(end_node) that iterates over the whole graph
183   calling ir_vrfy so that the graph can be verified after each
184    optimization.
185
186  + DONE: Add access routines to ir_graph, ir_mode (?).