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