GIMPLE Tuples
This is a new internal representation for GIMPLE. It is is a tuple-like representation instead of the current notion of treating everything as a 'tree'. Discussions on the proposed approach can be found here:
This document describes the proposed design. All the work is being done on the SVN branch gimple-tuples-branch. The document is still under construction and will change as the API evolves.
Building the branch (updated 2008-05-05)
The branch bootstraps with all primary languages. The major missing functionality includes:
- libmudflap (mudflap not converted yet)
- libgomp (likewise)
To build the branch:
$ cd <bld> $ <src>/configure --disable-libgomp --disable-libmudflap $ make
When submitting patches, please make sure that your patch bootstrap as above and you do not have new regressions against the failures in the base branch.
Plan
[done] Gimplify libgcc
[done] Gimplify all of compile.exp
[done] Gimplify all the testsuites for C.
[done] Generate RTL from tuples
[done] Generate low GIMPLE
[done] Build the CFG
[done] Re-write RTL expander
- Convert disabled passes.
[done] pass_apply_inline
[done] pass_ccp and folding interface
[done] pass_cd_dce
[done] pass_ch
pass_check_data_deps
[done] pass_cleanup_cfg_post_optimizing
pass_complete_unroll
[done]pass_convert_to_rsqrt
[done] pass_copy_prop
[done] pass_create_structure_vars
[done] pass_cse_reciprocals
[done] pass_cse_sincos
[done] pass_cselim
[done] pass_dce
[done] pass_dce_loop
[done] pass_del_ssa
[done] pass_dominator
[done] pass_dse
[done] pass_early_inline
[done] pass_early_warn_uninitialized
pass_empty_loop
[aldyh] pass_expand_omp_ssa
[done] pass_fold_builtins
[dnovillo] pass_forwprop
pass_fre
[done] pass_free_cfg_annotations
[done] pass_free_datastructures
[done] pass_inline_parameters
[done] pass_ipa_function_and_variable_visibility
[done] pass_ipa_early_inline
pass_if_conversion
pass_ipa_cp
pass_ipa_increase_alignment
[done] pass_ipa_inline
pass_ipa_matrix_reorg
pass_ipa_pta
[done]pass_ipa_pure_const
[done]pass_ipa_reference
pass_ipa_struct_reorg
pass_ipa_type_escape
pass_iv_canon
[done] pass_iv_optimize
pass_late_warn_uninitialized
[done] pass_lim
pass_linear_transform
[done] pass_loop_prefetch
[done] pass_lower_eh
[done] pass_lower_vector
[done] pass_lower_vector_ssa
[done] pass_mark_used_blocks
pass_merge_phi
[done] pass_nrv
[done] pass_object_sizes
pass_parallelize_loops
[done]pass_phi_only_cprop
[done]pass_phiopt
[done]pass_phiprop
pass_pre
[done] pass_predcom
pass_reassoc
[done] pass_rebuild_cgraph_edges
pass_record_bounds
[dnovillo] pass_refactor_eh
pass_release_ssa_names
[done] pass_remove_useless_stmts
[done] pass_rename_ssa_copies
[done] pass_return_slot
[done] pass_scev_cprop
[done] pass_simple_dse
[done] pass_sink_code
[done] pass_split_crit_edges
[done] pass_sra
[done] pass_sra_early
pass_stdarg
[done] pass_store_ccp
[done] pass_tail_calls
[done] pass_tail_recursion
pass_tree_ifcombine
[rakdver] pass_tree_loop
[rakdver] pass_tree_loop_done
[rakdver] pass_tree_loop_init
[done] pass_tree_profile
pass_tree_unswitch
pass_uncprop
pass_vectorize
[done] pass_vrp
[done] pass_warn_function_return
[done] Go through execute.exp successfully
[done] Go through check-gcc
[done] Bootstrap with --enable-languages=c
- Convert other primary FEs
[done] Fortran
[done] C++
[done] Java
Go through make all check with bootstrap disabled and all languages enabled
- Bootstrap with all default languages
Convert primary platforms
- arm-eabi
- i386-unknown-freebsd
- i686-pc-linux-gnu
- i686-apple-darwin
- mipsisa64-elf
- powerpc64-unknown-linux-gnu
- sparc-sun-solaris2.10
- x86_64-unknown-linux-gnu
- Convert mudflap
[aldyh] Convert OpenMP
Convert secondary platforms
- hppa2.0w-hp-hpux11.11
- powerpc-ibm-aix5.2.0.0
- powerpc-apple-darwin
- i686-pc-cygwin
- i686-mingw32
- ia64-unknown-linux-gnu
- s390-linux-gnu
- Convert secondary languages
- Ada
[done] Objective-C
[done] Objective-C++
Cleanups and other TODOs
Add as needed and claim the ones you are working on
Remove fallback in gimplify_expr and figure it out from the predicate
- Force every gimplification helper to return with the expression completely gimplified
Whenever possible, convert buildN/gimplify_and_add calls into build_gimple_*/gimple_add, to avoid the overhead of calling the gimplifier unnecessarily.
[done] TREE_SIDE_EFFECTS is important for GS_CALL. pure/const/etc attributes must be mapped
Document all arguments in gimplify_*
Remove GIMPLE_MODIFY_STMT
- Make the sequences a flat array instead of a double-linked list. Use some dynamic array representation that supports insertion/removal in the middle efficiently.
Fix all the FIXME tuples in the code
- Convert all the GIMPLE routines in all targets
[done] Remove all warnings
- Stop the gimplifier from modifying the input tree. Currently, rewriting the input is used when the caller wants a GIMPLE operand to be returned. It is also used during gimplification by the helper functions to simplify the input tree as they go. If we didn't need this, we could do away with the need to unshare all the trees when gimplifying full functions.
- Further factorize the gimple_statement_* structures. Every tuple with operands should have the same gimple_statement_with_operands base (e.g. all the OpenMP tuples, GIMPLE_TRY, GIMPLE_CATCH, etc)
[done] Remove block_stmt_iterators. See note in tree-flow-inline.h.
Replace fold_defer_overflow_warnings/fold_undefer_overflow_warnings with a tagging scheme. When fold() returns a result that has overflown, tag the result and emit the warning only when the result is put back into the IL.
[dnovillo/aldyh] Document new GIMPLE API.
[done] Remove field works_with_tuples_p from struct tree_opt_pass.
Move most of the folding code in tree-ssa-ccp.c into gimple-fold.c.
- Convert builtin expanders to run on gimple tuples prior to conversion to trees, or otherwise eliminate their callbacks into the tuples world.
Modify GIMPLE_CALL builders to pass the LHS of the call to gimple_build_call_*.