*** empty log message ***
[libfirm] / TODO
1   * 24.3.2003 Goetz
2     tarval requirements:
3     zu register_mode:
4     Ich haette ganz gerne
5       new_ir_mode(ident* name, int size, int alignment, mode_sort sort);
6     modecode ist der naechste frei int > maxenum.
7     Und der konstruktor sollte auch nach den zwei inits aufgerufen werden koennen.
8     was spricht dagegen?  (die zwei inits stehen in init_firm(), ein benutzer kann
9     schwer dazwischen andere methoden aufrufen.)
10
11   * 24.3.2003 Goetz
12     tarval requirements:
13     - if overflow either return no tarval or return result of overflow
14       computation.  Offer to output a warning. (configurable)
15     - Div:  configure rounding (up/down) in init_firm, remark in each Div node
16       rounding sheme, default by initializations, pass rounding sheme
17       to tarval module
18     - impelement tarval_bitpattern
19     - make routine that outputs parts < 32 bits from any tarval
20       at given position in a C type that is exactly 32 bits.
21       For this test C types for their size or use int32 in integer.h
22       (is this standard C??)
23     - add routine that outputs the position of the largest set bit.
24
25   * 29.10.2002 Goetz
26     Representation of value compounds is not good, especially with
27     calls.
28
29   * 29.10.2002 Goetz
30     We can not represent bitfield members of structs in C.
31     A struct can have fields with n bits, n e.g. set to 3...
32
33   * 29.10.2002 Goetz
34     If parameter variables are dereferenced they must be represented
35     by an entity in the stack frame type.  We need a mechanism to
36     find out which fields were parameters so that the parameter
37     passing space on the frame can be used for the parameters.
38
39   + 19.11.2001 Goetz
40     SymConst mit ident taugt nicht:  Wenn man z.B. die Prozedur kennt
41     sollte man die entitaet der Prozedur angeben koennen.  Ermoeglicht
42     einfachere Navigation im Callgraphen.
43     --> Verwende Const mit entity.
44
45   + 13.11.2001 Goetz
46     Aufbau Exceptions tut nicht:
47     1) mache exception handle block
48     2) baue code auf, verzweige von fragile ops zu dem Handler
49     3) mature exception block
50     --> Dann werden natuerlich die Werte am Ende der Bloecke mit den
51        fragile ops verwendet!  Diese sind ev. nicht berechnet.  Trifft
52        insbesondere auf memory zu ...
53     Loesung z.B.:
54     immExcBlock konstruktor.  Neuer "mature" status.  immExcBlocks duerfen
55     keine zyklen bilden.  In immExcBlocks werden PhiKnoten sofort eingesetzt,
56     aber wie immBlock mit flexibler vorgaenger liste.  add_in_edge ergaenzt
57     bei allen Phi Knoten dann sofort die neu bekannten Werte.  Jetzt kann
58     genau der Status zum Zeitpunkt der Exception abgebildet werden.
59
60   + 7.11.2001 Goetz
61     Model Stack frame of a method as class type as for Global type?
62     (Class so that methods defined within methods can be represented?)
63     So far local entities are added to GlobalType.
64
65   + 7.11.2001 Goetz
66     Implement support for endless loops.
67     (Add Jump target block to a list if optimizing Cond nodes.
68     Extend walker to start walking at this list.
69     Extend dead node elimination to update and compact this list.
70     Extend inlining to inline this list.)
71
72   * 7.11.2001 Goetz
73     Implement checking whether layout is fixed when setting corresponding
74     flag.  See firmtut, 3.1.4.
75     Maybe write a checker for the type information.
76
77   * 19.6.2001 Goetz
78     What happens if undefined values are allowed?  See ircons.c,
79     grep for get_irg_start_block.
80
81   + 23.5.2001 Goetz
82     Does the array type contain a field with the array entity?
83     This entity should be constructed automatically with the array type.
84
85   * 23.5.2005 Goetz
86     All compound types need a flag saying whether the order of the members
87     must be conserved.
88
89   + 23.5.2001 Goetz
90     Add element_type to array constructor
91
92   + 15.3.2001 Goetz
93     mode, size in type:  Wann gibt es einen mode, wann die size?
94     Kann man den mode aendern?  Nicht bei prim, enum, pointer da
95     schon irreversibel in Programmcode umgesetzt.  Die anderen
96     haben keinen mode.  Reicht daher intern ein Feld?  Muss man
97     in get_type_mode die typen asserten, und set_mode verbieten,
98     dafuer im enum konstruktor mode mitgeben?
99
100   + 14.3.2001 Boris
101     make dist should create an archive which has the directory libfirm/
102     as top-level
103 =======
104   14.3.2001 Boris
105   - make dist should create an archive which has the directory libfirm/
106     as top-level [DONE:28.3.2001 Boris]
107   - Datei 'Copyright' oder 'Copying' mit entsprechendem Copyrightverweis
108
109 *********** old stuff ***********
110
111  + Problem mit endlosen Schleifen loesen.
112
113  * Automatisches generieren und set_value der Argumente-projs in
114    new_ir_graph
115
116  + Define and implement procedure-global extensions, e.g., the call graph.
117
118  * Implement Confirm node: Added by optimization to annotate dataflow
119    edge with information as (value > 0).  This improves dataflow analysis.
120    These nodes can be derived from Cmp nodes in conjunction with dataflow
121    information.
122
123  * think again about implementation of boolean expressions  (0<1) && (2<3)
124
125  * Add evaluation routines for Rotate, Not, Minus, ShrA to target value,
126    extend optimization to cover these nodes.
127
128  * do we need remainder (Rem) operator?
129    different sign handling than Mod.  How much processors???
130
131  * Turn Quot, Minus into three letter operator.
132
133 Propositions by Boris, 5.3.2001:
134  + Fehler in FIRM?
135    ---------------
136    + in oo_program_example ist das Feld einfach nur eine entity. Aber alles andere
137      hat einen bestimmten Typ (z.B. method, strct, etc.). Muß es dann nicht auch
138      field geben? Oder werden alle Felder eines Objekts in einem strct organisiert
139      -> HowTo Use FIRM - Doku.
140      ==> Wann eine entitaet ein Feld ist, laesst sich am Typ der Entitaet enkennen.
141          Entitaet ist Feld wenn Owner Klassentyp (oder ev. Struct) und Typ nicht
142          Methodentyp.
143          Speicherbedarf der Entitaet, d.h. ihr mode, laesst sich auch dem Typ ansehen.
144          Manche Typen enthalten explizit den mode (z.B. type_primitive, type_pointer.)
145          Bei anderen haengt die Groesse vom Layout ab:  class, struct.
146          Frage (fehlende Konvention): Ist eine Klasse ein Pointer oder immer nur
147          eine Value-Class??  Je nach dem muss man die Entitaeten modellieren:
148          Klasse = Pointer:  entitaet kann Typ=class haben.
149          Klasse = WerteKlasse: entitaet sollte pointer mit points-to Klasse sein.
150    - fehlende Optimierung: wenn ein Wert einer Ladeoperation nicht gebraucht wird,
151      dann gibt es auch keine Kante dafuer, aber die Ladeoperation bleibt
152      (unnoetigerweise) stehen.
153    - mit set_optimize(1) geht die Optimierung von if(const cmpop const) unvollständig
154      bzw. falsch [da bleibt wohl ein zweiter Block-Knoten ohne Vorgänger]
155  + Verbesserungsvorschläge:
156    ------------------------
157    + Knoten im Typgraphen mit Farbe hinterlegen
158    - Attribute im Firmgraphen nicht im Knoten
159    + Kanten je nach Sematik farbig markieren, vielleicht dann auch Knoten
160      (z.B. rot fuer alles, was mit Steuerfluss zu tun hat)
161    + konfigurierbar, ob Konstanten im Startblock, oder im aktuellen
162      ==> geht schlecht.
163    + von Hochsprachtypen loesen? Signed32 statt int?
164      ==> viel Arbeit, nur Namenskonvention.  Ev wenn target value modul
165          ausgetauscht.
166
167  + if_while_example ergibt Segmentation Fault da Bad Vorgaenger von Endblock.
168    Optimierung des end blocks geaendert.
169
170  + define Nodes for Rotate, Not, Minus, ShrA.  Extend irdump, verification.
171
172  + change impelmentation of type to use concept as in irnode.
173    Three common fields: kind, ident, mode !!! fill mode with
174    mode_none if applicable.
175
176  + add asserts in type.c that check that proper type is passed.
177    not in get_type_name, get_type_ident.
178
179  + type / entity not good, too much casts.
180    merge type_or_ent union with type union. ??!!
181    allocate always unions.
182    write access routines for type, e.g. get_type_name.
183    change access routines for individual types to select from union.
184
185  + Wann macht man Dispatch Tabellen.  Lower Phase
186
187  + integrate irgmod into ircons.  The routines in there are only needed
188    during ir construction.  (If there are some not needed, remove them.)
189
190  + Build more structured directoriy structure:
191    ir/ir                irgraph, irnode, irop, irmode, type, entity,
192                         common,
193    ir/manipulate        ircons, irgmod, irvrfy
194    ir/optimize          iropt, irflag
195    ir/datastructure     array, obst, pdeq, pset, set
196    ir/include           gmp, host, xfprintf, xgprintf, xmalloc,
197                         xoprintf, xp_help, xprintf
198    ir/compilermodules   ident, xx_ident, tv, ieee754
199    ir/aux               irdump, strerror,
200    where goes           debug, firm, label, mangle, misc, panic, tune?
201
202  + Changes to nodes:
203    - SymConst also returns pointer.
204    - Start returns pointer to segment for globals.
205    - remove copy, clear, type_or_ent
206    - add free
207    - add constructor for shrs
208    - remove Phi0 ruins
209
210  + How shall global variables be modeled in FIRM, if programs as C are
211    translated?  Modeling them as entity of the class defined for the
212    file/compilation unit is not sufficient, as then they are not
213    visible from out of this file.
214    For the uebprakt and kirmes we model them by selection from the
215    area that contains all globals (data segment).  The pointer to
216    this area is provided by the start node.
217    In Sather these were modeled by pointers to string constants containing
218    the name of the global variable (or static field):
219      new_Const (mode_p, tarval_p_from_str ("VAR_A"))
220
221  + port transform_node in iropt to lib.
222
223  + make new Version
224
225 ***************************************************************************
226
227  + add attributes from doku to constructors.
228
229  + add Phi_in stack as field to ir_graph??!!
230
231  + implement ShrA constructor.
232    What are allowed types?
233
234  + add type struct
235
236  + write dumper for type information.
237    write dumper for type and graph.
238    write dumper for control flow graph.
239
240  + dump irgraph with all the type information.  Write function that
241    dumps type information and one that dumps entities.  To integrate
242    this separate dump_node and the recursion, and add the dump_type
243    and dump_entity function in the recursive iterator or write second
244    dump routine.
245
246  + Fix bug in pset/set, so that several tables can be used. iropt/identify
247    aborts. Thanks, Boris!
248
249  + write example program with irreducible control flow:
250
251    /* Phi node with three predecessors: */
252       a = 1
253       if () goto loop
254       a = 2
255       goto loop
256    loop:
257       if () goto exit
258       b = 1
259       goto loop
260    exit:
261       b = a
262
263    /* irreducible two entry loop */
264       b = 1
265       if () goto entry1 else goto entry2
266    entry 1
267       a = 2
268       if () goto exit else goto entry 2
269    entry 2
270       a = 1
271       if () goto exit else goto entry 1
272    exit
273       b = a + b
274
275  + entity must be able to take arrays as owner.  Anything else?
276    --> assert allowed types.
277
278  + Alloc must be able to take any type as owner.  Also primitive types
279    so that allocation to the stack of dereferenced local variables can
280    be modeled.
281
282  + Implement vrfy_graph(end_node) that iterates over the whole graph
283   calling ir_vrfy so that the graph can be verified after each
284    optimization.
285
286  + DONE: Add access routines to ir_graph, ir_mode (?).