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