12.3.2001 Boris added auto documentation in Makefiles, configure, etc example in ir/ir/ircons.c - much must be added creation of documentation by 'make autodoc' in architecture directory 5.3.2001 Boris added lots of #ifdef HAVE_CONFIG_G #include "config.h" #endif replaced some C++ style comments (//) by standard C comments /**/ added autoconf stuff worked this night: - configure (with some features, see --help for more) - make [depend | tags | install] - make [run] in testprograms did not work: - compilation on SunOS - make dist - automatic call of autoconf if required 5.3.2001 Goetz More colours in vcg output. Fixed bug: cse found that start block equals it's first successor as both have the Start block as predecessor. This only happens for local_optimize_graph() as during construction the Start block is not entered in the value table. Changed implementation: irgmod: local_optimize_graph() did not empty the hash table with the irnodes for cse. This might cause that cse turns up with a node that seems better but was removed from the graph in an earlier optimization phase. Removed old #if 1 from ircons.c Commented in call of optimization for Block nodes in irgopt.c, copy_preds(): Optimizes blocks that had bad predecessors. Same for Phi nodes. 27.2.2001 Goetz Moved struct from irprog.h to irprog_t.h, same for irmode.h. Added a module deb_info in debug.h. Adapted makefile. Added example use in iropt.h. Removed use of debug.h in ident.c. Now debug.c|h can be moved to /adt/. Removed inabled code for dead node elimination in irgopt.h. Renamed some missnamed access routines (_of_). Macros with old names are in old_fctnames.h. Edited makefiles to remove #* and *.flc. ??.2.2001 Goetz Some minor bugfixes... 25.1.2001 Goetz After compacting of in arrays in dead_node_elimination merge blocks and remove Phis with one pred. 24.1.2001 Goetz Freeing of obstack in dead_node_elimination commented in. Compacting in arrays of Block and Phi nodes in dead_node_ elimination. Some more changes... 15.01.2001 Goetz added set/get_SymConst_type_or_id in irnode.h added field offset to entity in entity.h added field size to type_class in type.h include "gmp.h" in tv.h with "" instead <> 12.01.2001 Goetz Some changes to make the lib better portable 29.12.2000 Goetz Initialize max_node_nr in irprog. 27.12.2000 Goetz Now outputs warning if faulty type in irdump, dump_type_info. Explicit string termination in irdump, vcg_open. 20.12.2000 Goetz Added external to declaration of irp. Added typedef before pns and pnc_number. irmode.c, init_mode(): We need to memset all new modes as tarval_vrfy reads fields before they are initialized: It compares to min/max when tarvals for min/max are allocated! 18.12.2000 Goetz Changed parameter of Methods in type.h and type.c from class to clss. Class is a C++ keyword. 10.12.2000 Goetz Changed some testprograms to accomodate Uebprakt. 7.9.2000 Goetz Finished implementation of dump_all_types. Added new testprogram inheritance_example. 6.9.2000 Chris Added seven access routines in type.[hc]: get_class_n_member, get_class_n_subtype, get_class_n_supertype, get_strct_n_member, add_strct_member, get_strct_member and set_strct_member. Fixed the type_walk_2 for those seven routines. 6.9.2000 Goetz Added irdump routine dump_all_types. Did changes to irprog, type, typewalk to achieve this. typewalk needs to walk along members, sub and supertypes, this is still missing! irdump then needs to output these edges. ====================================================================== ==================== New version: 0.2.5 ============================== ====================================================================== 3.9.2000 Goetz Made new Version: 0.2.5 15.8.2000 Goetz until 3.9.00 Separated irnode.h and many others into two files: one public one private. Added funcionality to extract headers for lib. 23.8.2000 Goetz type_dump also dumps irg->ent if_example: corrected nr of locals 16.8.2000 Goetz irgopt: Correct copy of self pointer in start block. irgopt: Correct treatment of loops: pre function in walker breaks all possible loops in Phi and Block nodes. irr_loop_example: wrong Return statement Now I fixed all but one error: in memory_example. This error showed a conceptual problem, so I wrote a slightly different algorithm. This now runs for all testprograms. dead_node_example: cse is buggy!! merges start and the following block! 15.8.2000 Goetz looking at bug in dead_node_elimination. Following fixes: irnode: all get_..._arr functions changed ircons: new_r_Block: set matured flag. ircons: new_r_SymConst: needs mode_p for linkage_ptr_info. adapted call_str_example to new concepts. 2.8.2000 Goetz Implemented simpler Phi construction algorithm that constructs correct code for three_cfpred_example in ircons. This algorithm generates more Id nodes than the original algorithm and therefore is less effective. Also made some changes to optimizations of Not. 31.7.2000 Chris Fixed a bug, caused by the recursive use in type.h and entity.h. Deleted the _TYPE_TYPEDEF_ and inserted the _ENTITY_TYPEDEF_ instead. Fixed a problem in if_while testprogram, so it now works. 20.7.2000 Goetz Fixed bug in optimize(). Returned Null instead n if get_optimize() == false. 19.7.2000 Christian Added some access routines in type.[hc]. Solved a recursive definition of type_class struct, entity struct and type union. 18.7.2000 Goetz Separated entity header into pure functional header and header with data types. Goetz ... a bunch small changes not documented 12.7.2000 Goetz Changed output of oo_prog_example: now uses the internal list of all irgs. Had to implement some of the access routines for that. Also fixed a bug in irdump. Main routines did not use current_ir_graph properly. 12.7.2000 Goetz Implemented some missing parts in irgopt. Added field irg to entity. Only valid if entity is a method. Had to resove a cyclic de[endency between irgraph.h and entity.h for this. Added fields sub and super to type_class for inheritance. Added field main_irg to irprog. 7.7.2000 Chris Fixed some bugs in irgopt.c Added some missing 'get_new_node' methods, so the new obstack contains the correct nodes. 6.7.2000 Chris Renamed ir_vrfy to irn_vrfy and vrfy_graphg to irg_vrfy. Solved some copy'n'paste problems. Deleted most debug-code! Added comments to several files. 6.7.2000 Goetz Fixed bug in _r_ constructors for all four Div operations. Fixed bug in turn_into_tuple: didn't remember the block. Tested transform_node. 5.7.2000 Goetz Fixed some testprograms to new semantics of firm. Added testprogram global_var_example. Fixed a bug in irop: Size of Sel node was (entity *) instead of sel_attr. Therefor array_heap_example aborted. Also found a missing break in typewalk, case iro_Alloc. Added a construct that unifies all things constructed by the lib and needed to represent a program: irprog.ch This contains a list of all types as well as a list of all ir graphs. I added calls to initialization and constructors so that this is constructed automatically. I changed firm.c, type.c, irgraph.c and ev. more. Removed strange block struct and constructor from ircons.c. Moved routines for automatic Phi construction from irgmod to ircons. Sorted functions in ircons to reflect the different interfaces. Renamed dataseg to globals to be conformant with documentation. Added conservation of current_ir_graph to irgopt.c. Corrected bug in Makefiles: wrong path to directory ./inlude. 4.7.2000 Goetz Commented a whole bunch of stuff, e.g. in ircons.h (Procedure to construct) We should change the naming of the Block constructor. Removed acces routines to attr. "closed" of Block. Removed second implementation of new_ir_node from ircons and some comments concerned with the now resolved cyclic dependency. Fixed some bugs in irgopt so that the compilation goes through. 29.6.2000 Chris Changed the irnode attribut 'visit' into 'visited'. Added some access functions, like get/set_irn_visit etc. 28.6.2000 Chris Renamed some access funtion in irgraph.*. Deleted two global flags (ir_visited and block_visited) from irgraph.*. Added two attributes to the irgraph struct. The visited flags belongs to a ir graph, not to a whole program. 26.6.2000 Chris A new optimization has been finished. The dead-node-elimination copies the existing ir graph from one opstack to another. While walking the graph, only the reachable nodes will be copied, so the "dead-nodes" (unreachable in the controlflow) are removed. 19.6.2000 Chris Solved some problems in the 'copy_node' function. The in array was not as easy as it seamed. 16.6.2000 Chris Wrote a new 'post' funtion, for future use in 'dead-node-elimination' optimization, which is needed in the paramter list of 'irg_walk'. 14.6.2000 Chris Moved 'optimze_in_place_wrapper' from iropt.* tothe new files irgopt.*. New functions 'local_optimze_graph' and 'dead_node_elimination' are added, but not finished. 31.5.2000 Chris Removed some files from the archive, after dependencies and usage are checked: - 'ir/common/strerror.c' was nowhere used; - 'ir/ident/xx_ident.h' an empty file, only included by 'ident.c', but never used; - 'ir/tv/label.c' and - 'ir/tv/label.h' contained a numeric counter; The files were included in 'tv.h' and implemented in 'tarval.c'. The two functions 'tarval_label' and 'tarval_forall_labeled' were also never used. In the old fiasco compiler, the label thing is used in the backend. Search for 'babil' to see the usage. Also removed the two attributes 'lab' and 'used' in the tarval struct. 26.5.2000 Chris Moved the 'new_ir_node' constructor from ircons.* to irnode.* and fixed afterwards some recursive includes, so libfirm works again. 2+3.2000 Goetz Did a lot of changes, which I never commented until now (4.7.00). * Added new result to Start node: Pointer to global data segment. * Extended Semantics of SymConst node to represent information for the linker. * Added arithmeitc nodes (Shrs, Minus ...) Rearranged the directory structure and adjusted the makefiles. The directories contain: ir: everything for the intermediate representation (better: src?) /ir: the ir itself, and standard optimizations. /tv: the target value module /tr: the type and entity representation /adt: abstract data types /common: stuff needed by all other dirs /debug: debugging Unterstuetzung /ident: include: external files needen as includes testprograms: examples to test the lib. The makefiles generate files with extension .d that contain the dependencies between the files. 15.2.2000 Goetz Added access routine to attribute link of irnode in irnode.ch. Added get_negated_pnc to irnode.ch. 14.2.2000 Goetz Added an iterator in iropt that calls the optimization for all nodes. Copied optimize's code to optimize_in_place and removed deallocations. Made set_irn_n in irnode.c public. Added Bad as possible cfg predecessor in is_cfg_node in irnode. Bads are allowded as cfgpredecessors to represent dead "incoming" control flow. Added call to optimize_in_place in mature_block. Is this useful? 10.2.2000 Goetz Changed tests from comparing enums to comparing pointers. This is more efficient (is it?) and reads better. e.g., instead get_irn_opcode == irm_And now get_irn_op == op_And 10.2.2000 Goetz Compared equivalent_value to the one in the original fiasco. Added a test in case iro_And. Changed implementation of iro_Div. Added routines turn_into_tuple and set_irn_op() in irgmod/irnode. Changed implementation of irn_Minus (although commented out). Now all features are ported or documented for this function. 10.2.2000 Goetz Compared computed_value to the one in the original fiasco. Added one further optimization in case iro_Proj. Now all features are ported for this function. 9.2.2000 Goetz Updated comments in ircons.h. 9.2.2000 Goetz Changed possible attribute of SymConst from type_class to type. SymConst size could be the size of a union, array, ... 9.2.2000 Goetz Implemented two dumpers that dump type information and a graph with type information. 9.2.2000 Goetz Implemented a walker that walks over the type informatin that can be reached from an ir node. Added routine get_kind(firm_thing) in common.h, Added file common.c. Added files typewalk.ch and routines to irdump. Added visited flags and initialization to entity and all types. Implemented some of the missing access routines in type.c, entity.c 9.2.2000 Goetz Implemented constructor for ShrA. Added type struct. Added routine that iterates the graph and verifies all nodes. Added Phi_in stack to irgraph. This allows to build several graphs at once with respect to the Phi building algorithm. 9.2.2000 Goetz Implemented dumper for control flow graphs. Changed irr_* and dead_* examples to dump cfg. 8.2.2000 Goetz Implemeted explicit stack for the Phi node generation. See ircons.c. 8.2.2000 Goetz added include string.h in xoprintf.c to get rid of warning: implicit declaration of function `bcopy' 7.2.2000 Goetz Worked on iropt.c: Added more cases to equivalent_node. Portet gigo, identify, identify_remember. The set/pset library can not handle several hash tables. At least, compiling several procedures causes a segmentation fault during access to the tables (oo_program_example). Need to work on this. transform_node still needs to be ported. some cases in equivalent_node are still missing. To get it running I had to remove the call to optimize in the new_Block constructor. It can only be called when the Block is mature. 7.2.2000 Goetz Introduced a walker that walks only over blocks. The asserts might be too strict for general graphs, but so far it works. For the walker I introduced an additional flag in the attribute of Blocks, an a global block_visited variable (in irgraph.h). Furhter I modularized dump_ir_node, implemented dump_ir_graph with the existing walker, and added new routines to output a basic block graph. Changed the examples to call the new dump routine. 7.2.2000 Goetz Added auxiliary routines to ir_node: skip_Proj, skip_Nop, is_Bad ... Changed access routines to use get_irn_n instead of explicit array accesses. Changed get_irn_n to call skip_Id, so that the access routines never will return Id nodes. 3.2.2000 Goetz Repaired Phi computation, changed new_r_Phi_in. Added test program to test irregular controlflow. 2.2.2000 Goetz Updated optimizations computed_value and equivalent_node to new Syntax of FIRM nodes and to use access routines. Added routine skip_Proj in irnode. 2.2.2000 Boris Boesler Added files irgwalk.c and irgwalk.h. They include a simple function to traverse an ir graph and execute pre and post functions to current node. 1.2.2000 Goetz Added arrays with parameters and result types to the type informtion of a procedure. This is needed for the code generation. Also added the corresponding access routines. Adapted the testprograms. 1.2.2000 Goetz Found a bug / complication: the call order get_value (makes Phi0, put's it into graph_arr) set_value (overwrites Phi0 in graph_arr) mature_block (upgrades Phi0, puts it again into graph_arr, overwriting the proper value.) fails. Added test wether graph_arr is already set in phi_merge. Added tons of comments to explain Phi generation -- the stack hack. 27.1.2000 Goetz irdump now outputs the pnc_number for projs of Cmp nodes. Added routine to access the pnc_string. 27.1.2000 Goetz Added result "dataseg" to Start node, with all it's consequences. We need this for the compiler lab to translate global variables. Now they can be selected from the data segment, and the start node supplies the pointer to this segment. These changes are guarded by preprocessor variable UEBPRAKT in common.h Changed files: common.h, irgraph.ch, irnode.h 26.1.2000 Goetz Testprograms: removed array_example, added array-heap_example and array-stack_example and adapted makefile. ir_lib: Entity now also allows type_method as owner. This is to model the stack, Sel nodes that select a variable (array) from the stack need an entity that describes what they select. This entity gets the type of the enclosing procedure as owner. 24.1.2000 Chris Added future access routines in `irmode.[ch]' as comments, that all attributes in the ir_mode struct can be user-defined. Added access routines in `irgraph.[ch]', for all attributes. 22.1.2000 Chris Moved verify routines from `irgraph.[ch]' to own files `irvrfy.[ch]'. Added `irvrfy.[ch]' to MAKEFILE Added "inline" before access routines in `irnode.h', that no warnings will appear furthermore. Added three more access routines in `irmode.[ch]': struct tarval *get_min_of_mode (ir_mode *mode); struct tarval *get_max_of_mode (ir_mode *mode); struct tarval *get_null_of_mode (ir_mode *mode); 21.1.2000 Goetz Adaption of Alloc, Sel and Entity to new types: Changed array_example to use type instead of type_class. Changed entity to allow all types as owner instead of only type_class. Added routine "assert_legal_owner_of_ent(type* type)". Changed alloc to allow allocating variables of any type instead of only type_class. Adapted all testprograms to avoid warnings. removed dtest ... from Makefile, replaced by test. 20.1.2000 Goetz Added "run" to makefile, added array_example to makefile of testprograms. Corrected testprogram array Changed assert in irvrfy -- Conv. Started Change log. Started TODO log.