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