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