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