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