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