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