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