2 Added implementation of overwrites stuff.
5 Implemented stuff to change the type graph. See
6 typegmod.h and tpop.h for basic documentation of the change.
7 There now exists a type of kind type_id. If this appears
8 externally this is a bug.
11 Added some new access routines to types.
12 List of overwritten fields for entities.
13 Removed a bug in irnode.
16 Added a routine to set the mangled entity name.
17 Added two routines to copy entites.
20 Entities now have two more flags, for visibility and allocation mode.
21 Types that have a layout have a flag indicating whether the layout is
25 We distinguish three kinds of Cond nodes. These can be distinguished
26 by the mode of the selector operand and an internal flag of type cond_kind.
27 First we distinguish binary Conds and switch Conds.
28 A binary Cond has as selector a boolean value. Proj(0) projects the control
29 flow for case "False", Proj(1) the control flow for "True". A binary Cond
30 is recognized by the boolean selector.
31 The switch Cond has as selector an unsigned integer. It produces as result
32 an n+1 Tuple (cf0, ... , cfn) of control flows.
33 We differ two flavours of this Cond. The first, the dense Cond, passes
34 control along output i if the selector value is i, 0 <= i <= n. If the
35 selector value is >n it passes control along output n.
36 The second Cond flavor differes in the treatment of cases not specified in
37 the source program. It magically knows about the existence of Proj nodes.
38 It only passes control along output i, 0 <= i <= n, if a node Proj(Cond, i)
39 exists. Else it passes control along output n (even if this Proj does not
40 exist.) This Cond we call "fragmentary". There is a special constructor
41 new_defaultProj that automatically sets the flavor.
42 The two switch flavors are distinguished by a flag of type cond_kind.
43 Default flavor is "dense"
47 tv now implements Minus, Abs.
48 iropt now optimizes these and Div, Mod, Quot, DivMod.
49 Still missing: Shrs, Rot.
50 tarval_shr somtimes performs shrs, depending on the compiler/system!!
51 If the ArmRoq implementation is faulty there might appear errors.
54 Changed ircons: If undefined values are used the Phi construction
55 inserts a constant with value tarval_bad.
58 Changed array bounds in type.h to ir_node*. This allows to
59 construct array bounds that are complex constant expressions
60 simpler. Further dynamic array bounds can be displayed.
61 Comment in ircons.c extended: undefined values in start_block.
64 ifdef'ed all uses of gmp in tv.c away. Optimizations for
65 mode_Z no more supported, as well as constants of that mode.
68 Dokumentation in ir_dump
69 Habe Routinen fuer einzelne Knoten/Kanten aus header entfernt:
70 Benutzen globale Variable die nicht oeffentlich zugaenglich ist.
73 We need an entity for the array elements for the Sel nodes. This
74 entity should be stored in the array type. Changed constructor
75 parameters: include array element type. Entity for elements is built
80 Faulty use of va_arg, became visible with new, stricter gcc 2.96.
83 Added list of member entites to union. unioned_types and delimiters
84 are superfluous now -- removed.
85 Rationale: we want to express selection of a union member as a Sel
86 node. for this we need to have entities. The entities contain the
87 unioned type and have as name the delimiters...
90 Changed Makefile/MakeTargets to install headers and libraries
94 Changed Makefile and Configure scripts to produce a proper tar file
95 for distribution (libfirm-VERSION.tar)
96 Use 'make distrib' instead of 'make dist'
99 Changed implementation of tr module. With this I also changed the
100 interface!! Type casts are unnecessary now, but some access funcions
104 ======================================================================
105 ==================== New version: 0.3.0 ==============================
106 ======================================================================
112 added creation of a tar archive for distribution
113 replaced ir/.dummy.in by ir/Makefile.in
116 Changed equivalent_node() and copy_preds() so that the end block
117 is not optimized away if it has no real predecessors. This fixes
118 the problem with the while examples.
119 Added while_example in Makefile
122 Fooled around with if_while_example: Why does cse make it abort?
123 Cse removes path to End node, Bad remains as pred of Endblock.
124 The block walker can't deal with this.
125 Made new example with only loop: while_example.
128 added auto documentation in Makefiles, configure, etc
129 example in ir/ir/ircons.c - much must be added
130 creation of documentation by 'make autodoc' in architecture directory
133 added lots of #ifdef HAVE_CONFIG_G #include "config.h" #endif
134 replaced some C++ style comments (//) by standard C comments /**/
137 - configure (with some features, see --help for more)
138 - make [depend | tags | install]
139 - make [run] in testprograms
141 - compilation on SunOS
143 - automatic call of autoconf if required
146 More colours in vcg output.
147 Fixed bug: cse found that start block equals it's
148 first successor as both have the Start block as predecessor.
149 This only happens for local_optimize_graph() as during construction
150 the Start block is not entered in the value table.
151 Changed implementation: irgmod: local_optimize_graph() did not
152 empty the hash table with the irnodes for cse. This might cause that
153 cse turns up with a node that seems better but was removed from the
154 graph in an earlier optimization phase.
155 Removed old #if 1 from ircons.c
156 Commented in call of optimization for Block nodes in irgopt.c, copy_preds():
157 Optimizes blocks that had bad predecessors.
162 Moved struct from irprog.h to irprog_t.h, same for irmode.h.
163 Added a module deb_info in debug.h. Adapted makefile. Added example
165 Removed use of debug.h in ident.c. Now debug.c|h can be moved to
167 Removed inabled code for dead node elimination in irgopt.h.
168 Renamed some missnamed access routines (_of_). Macros with old names
169 are in old_fctnames.h.
170 Edited makefiles to remove #* and *.flc.
173 Some minor bugfixes...
176 After compacting of in arrays in dead_node_elimination
177 merge blocks and remove Phis with one pred.
180 Freeing of obstack in dead_node_elimination commented in.
181 Compacting in arrays of Block and Phi nodes in dead_node_
186 added set/get_SymConst_type_or_id in irnode.h
187 added field offset to entity in entity.h
188 added field size to type_class in type.h
189 include "gmp.h" in tv.h with "" instead <>
192 Some changes to make the lib better portable
195 Initialize max_node_nr in irprog.
198 Now outputs warning if faulty type in irdump, dump_type_info.
199 Explicit string termination in irdump, vcg_open.
202 Added external to declaration of irp.
203 Added typedef before pns and pnc_number.
204 irmode.c, init_mode(): We need to memset all new modes as
205 tarval_vrfy reads fields before they are initialized: It
206 compares to min/max when tarvals for min/max are allocated!
209 Changed parameter of Methods in type.h and type.c from
210 class to clss. Class is a C++ keyword.
213 Changed some testprograms to accomodate Uebprakt.
216 Finished implementation of dump_all_types.
217 Added new testprogram inheritance_example.
220 Added seven access routines in type.[hc]:
221 get_class_n_member, get_class_n_subtype, get_class_n_supertype,
222 get_strct_n_member, add_strct_member, get_strct_member and set_strct_member.
223 Fixed the type_walk_2 for those seven routines.
226 Added irdump routine dump_all_types.
227 Did changes to irprog, type, typewalk to achieve this.
228 typewalk needs to walk along members, sub and supertypes, this
229 is still missing! irdump then needs to output these edges.
231 ======================================================================
232 ==================== New version: 0.2.5 ==============================
233 ======================================================================
236 Made new Version: 0.2.5
238 15.8.2000 Goetz until 3.9.00
239 Separated irnode.h and many others into two files: one public
241 Added funcionality to extract headers for lib.
244 type_dump also dumps irg->ent
245 if_example: corrected nr of locals
248 irgopt: Correct copy of self pointer in start block.
249 irgopt: Correct treatment of loops: pre function in walker
250 breaks all possible loops in Phi and Block nodes.
251 irr_loop_example: wrong Return statement
252 Now I fixed all but one error: in memory_example.
253 This error showed a conceptual problem, so I wrote
254 a slightly different algorithm. This now runs for
256 dead_node_example: cse is buggy!! merges start and the
260 looking at bug in dead_node_elimination.
262 irnode: all get_..._arr functions changed
263 ircons: new_r_Block: set matured flag.
264 ircons: new_r_SymConst: needs mode_p for linkage_ptr_info.
265 adapted call_str_example to new concepts.
268 Implemented simpler Phi construction algorithm that constructs
269 correct code for three_cfpred_example in ircons. This algorithm
270 generates more Id nodes than the original algorithm and therefore
272 Also made some changes to optimizations of Not.
275 Fixed a bug, caused by the recursive use in type.h and entity.h.
276 Deleted the _TYPE_TYPEDEF_ and inserted the _ENTITY_TYPEDEF_ instead.
277 Fixed a problem in if_while testprogram, so it now works.
280 Fixed bug in optimize(). Returned Null instead n if
281 get_optimize() == false.
284 Added some access routines in type.[hc]. Solved a recursive definition
285 of type_class struct, entity struct and type union.
288 Separated entity header into pure functional header and header
292 ... a bunch small changes not documented
295 Changed output of oo_prog_example: now uses the internal list
296 of all irgs. Had to implement some of the access routines for
297 that. Also fixed a bug in irdump. Main routines did not use
298 current_ir_graph properly.
301 Implemented some missing parts in irgopt.
302 Added field irg to entity. Only valid if entity is a method.
303 Had to resove a cyclic de[endency between irgraph.h and entity.h
305 Added fields sub and super to type_class for inheritance.
306 Added field main_irg to irprog.
309 Fixed some bugs in irgopt.c
310 Added some missing 'get_new_node' methods, so the new obstack contains
314 Renamed ir_vrfy to irn_vrfy and vrfy_graphg to irg_vrfy.
315 Solved some copy'n'paste problems. Deleted most debug-code!
316 Added comments to several files.
319 Fixed bug in _r_ constructors for all four Div operations.
320 Fixed bug in turn_into_tuple: didn't remember the block.
321 Tested transform_node.
324 Fixed some testprograms to new semantics of firm.
325 Added testprogram global_var_example.
326 Fixed a bug in irop: Size of Sel node was (entity *) instead of
327 sel_attr. Therefor array_heap_example aborted.
328 Also found a missing break in typewalk, case iro_Alloc.
329 Added a construct that unifies all things constructed by the lib
330 and needed to represent a program: irprog.ch
331 This contains a list of all types as well as a list of all ir graphs.
332 I added calls to initialization and constructors so that this is constructed
333 automatically. I changed firm.c, type.c, irgraph.c and ev. more.
334 Removed strange block struct and constructor from ircons.c.
335 Moved routines for automatic Phi construction from irgmod to ircons.
336 Sorted functions in ircons to reflect the different interfaces.
337 Renamed dataseg to globals to be conformant with documentation.
338 Added conservation of current_ir_graph to irgopt.c.
339 Corrected bug in Makefiles: wrong path to directory ./inlude.
342 Commented a whole bunch of stuff, e.g. in ircons.h (Procedure to construct)
343 We should change the naming of the Block constructor.
344 Removed acces routines to attr. "closed" of Block.
345 Removed second implementation of new_ir_node from ircons and some comments
346 concerned with the now resolved cyclic dependency.
347 Fixed some bugs in irgopt so that the compilation goes through.
350 Changed the irnode attribut 'visit' into 'visited'.
351 Added some access functions, like get/set_irn_visit etc.
354 Renamed some access funtion in irgraph.*.
355 Deleted two global flags (ir_visited and block_visited) from irgraph.*.
356 Added two attributes to the irgraph struct. The visited flags belongs
357 to a ir graph, not to a whole program.
360 A new optimization has been finished. The dead-node-elimination copies
361 the existing ir graph from one opstack to another. While walking the
362 graph, only the reachable nodes will be copied, so the "dead-nodes"
363 (unreachable in the controlflow) are removed.
366 Solved some problems in the 'copy_node' function. The in array was not
367 as easy as it seamed.
370 Wrote a new 'post' funtion, for future use in 'dead-node-elimination'
371 optimization, which is needed in the paramter list of 'irg_walk'.
374 Moved 'optimze_in_place_wrapper' from iropt.* tothe new files irgopt.*.
375 New functions 'local_optimze_graph' and 'dead_node_elimination' are added,
379 Removed some files from the archive, after dependencies and usage are
381 - 'ir/common/strerror.c'
383 - 'ir/ident/xx_ident.h'
384 an empty file, only included by 'ident.c', but never used;
385 - 'ir/tv/label.c' and
387 contained a numeric counter;
388 The files were included in 'tv.h' and implemented in 'tarval.c'. The two
389 functions 'tarval_label' and 'tarval_forall_labeled' were also never used.
390 In the old fiasco compiler, the label thing is used in the backend.
391 Search for 'babil' to see the usage.
392 Also removed the two attributes 'lab' and 'used' in the tarval struct.
395 Moved the 'new_ir_node' constructor from ircons.* to irnode.* and fixed
396 afterwards some recursive includes, so libfirm works again.
399 Did a lot of changes, which I never commented until now (4.7.00).
401 * Added new result to Start node: Pointer to global data segment.
402 * Extended Semantics of SymConst node to represent information for the
404 * Added arithmeitc nodes (Shrs, Minus ...)
406 Rearranged the directory structure and adjusted the makefiles.
407 The directories contain:
408 ir: everything for the intermediate representation (better: src?)
409 /ir: the ir itself, and standard optimizations.
410 /tv: the target value module
411 /tr: the type and entity representation
412 /adt: abstract data types
413 /common: stuff needed by all other dirs
414 /debug: debugging Unterstuetzung
416 include: external files needen as includes
417 testprograms: examples to test the lib.
419 The makefiles generate files with extension .d that contain the dependencies
423 Added access routine to attribute link of irnode in irnode.ch.
424 Added get_negated_pnc to irnode.ch.
427 Added an iterator in iropt that calls the optimization for all nodes.
428 Copied optimize's code to optimize_in_place and removed deallocations.
429 Made set_irn_n in irnode.c public.
430 Added Bad as possible cfg predecessor in is_cfg_node in irnode. Bads
431 are allowded as cfgpredecessors to represent dead "incoming" control
433 Added call to optimize_in_place in mature_block. Is this useful?
436 Changed tests from comparing enums to comparing pointers. This is more
437 efficient (is it?) and reads better. e.g., instead get_irn_opcode == irm_And
438 now get_irn_op == op_And
441 Compared equivalent_value to the one in the original fiasco.
442 Added a test in case iro_And.
443 Changed implementation of iro_Div. Added routines turn_into_tuple
444 and set_irn_op() in irgmod/irnode.
445 Changed implementation of irn_Minus (although commented out).
446 Now all features are ported or documented for this function.
449 Compared computed_value to the one in the original fiasco.
450 Added one further optimization in case iro_Proj.
451 Now all features are ported for this function.
454 Updated comments in ircons.h.
457 Changed possible attribute of SymConst from type_class to type.
458 SymConst size could be the size of a union, array, ...
461 Implemented two dumpers that dump type information and a graph with
465 Implemented a walker that walks over the type informatin that can
466 be reached from an ir node.
467 Added routine get_kind(firm_thing) in common.h, Added file common.c.
468 Added files typewalk.ch and routines to irdump.
469 Added visited flags and initialization to entity and all types.
470 Implemented some of the missing access routines in type.c, entity.c
473 Implemented constructor for ShrA.
475 Added routine that iterates the graph and verifies all nodes.
476 Added Phi_in stack to irgraph. This allows to build several
477 graphs at once with respect to the Phi building algorithm.
480 Implemented dumper for control flow graphs. Changed irr_* and dead_*
481 examples to dump cfg.
484 Implemeted explicit stack for the Phi node generation. See ircons.c.
487 added include string.h in xoprintf.c to get rid of warning:
488 implicit declaration of function `bcopy'
492 Added more cases to equivalent_node.
493 Portet gigo, identify, identify_remember.
494 The set/pset library can not handle several hash tables. At least,
495 compiling several procedures causes a segmentation fault during access
496 to the tables (oo_program_example). Need to work on this.
497 transform_node still needs to be ported.
498 some cases in equivalent_node are still missing.
500 To get it running I had to remove the call to optimize in the
501 new_Block constructor. It can only be called when the Block is
505 Introduced a walker that walks only over blocks. The asserts
506 might be too strict for general graphs, but so far it works.
507 For the walker I introduced an additional flag in the attribute
508 of Blocks, an a global block_visited variable (in irgraph.h).
509 Furhter I modularized dump_ir_node, implemented dump_ir_graph
510 with the existing walker, and added new routines to output a
512 Changed the examples to call the new dump routine.
515 Added auxiliary routines to ir_node:
516 skip_Proj, skip_Nop, is_Bad ...
517 Changed access routines to use get_irn_n instead of explicit array
518 accesses. Changed get_irn_n to call skip_Id, so that the access routines
519 never will return Id nodes.
522 Repaired Phi computation, changed new_r_Phi_in. Added test program to
523 test irregular controlflow.
526 Updated optimizations computed_value and equivalent_node to new
527 Syntax of FIRM nodes and to use access routines.
528 Added routine skip_Proj in irnode.
530 2.2.2000 Boris Boesler
531 Added files irgwalk.c and irgwalk.h. They include a simple function to
532 traverse an ir graph and execute pre and post functions to current node.
535 Added arrays with parameters and result types to the type informtion
536 of a procedure. This is needed for the code generation. Also added
537 the corresponding access routines.
538 Adapted the testprograms.
541 Found a bug / complication: the call order
542 get_value (makes Phi0, put's it into graph_arr)
543 set_value (overwrites Phi0 in graph_arr)
544 mature_block (upgrades Phi0, puts it again into graph_arr, overwriting
546 fails. Added test wether graph_arr is already set in phi_merge.
548 Added tons of comments to explain Phi generation -- the stack hack.
552 irdump now outputs the pnc_number for projs of Cmp nodes.
553 Added routine to access the pnc_string.
556 Added result "dataseg" to Start node, with all it's consequences.
557 We need this for the compiler lab to translate global variables.
558 Now they can be selected from the data segment, and the start
559 node supplies the pointer to this segment.
560 These changes are guarded by preprocessor variable UEBPRAKT in
562 Changed files: common.h, irgraph.ch, irnode.h
566 removed array_example, added array-heap_example and
567 array-stack_example and adapted makefile.
569 Entity now also allows type_method as owner. This is to model
570 the stack, Sel nodes that select a variable (array) from the
571 stack need an entity that describes what they select. This
572 entity gets the type of the enclosing procedure as owner.
575 Added future access routines in `irmode.[ch]' as comments,
576 that all attributes in the ir_mode struct can be user-defined.
577 Added access routines in `irgraph.[ch]', for all attributes.
580 Moved verify routines from `irgraph.[ch]' to own files `irvrfy.[ch]'.
581 Added `irvrfy.[ch]' to MAKEFILE
582 Added "inline" before access routines in `irnode.h', that no warnings
583 will appear furthermore.
584 Added three more access routines in `irmode.[ch]':
585 struct tarval *get_min_of_mode (ir_mode *mode);
586 struct tarval *get_max_of_mode (ir_mode *mode);
587 struct tarval *get_null_of_mode (ir_mode *mode);
590 Adaption of Alloc, Sel and Entity to new types:
591 Changed array_example to use type instead of type_class.
592 Changed entity to allow all types as owner instead of
593 only type_class. Added routine "assert_legal_owner_of_ent(type* type)".
594 Changed alloc to allow allocating variables of any type instead of
596 Adapted all testprograms to avoid warnings.
598 removed dtest ... from Makefile, replaced by test.
601 Added "run" to makefile, added array_example to makefile of testprograms.
602 Corrected testprogram array
603 Changed assert in irvrfy -- Conv.