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