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