public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Scripted pass manager
@ 2007-11-27  0:38 Rob Quill
  2007-11-27 19:07 ` Richard Guenther
  2007-12-05  0:14 ` Diego Novillo
  0 siblings, 2 replies; 14+ messages in thread
From: Rob Quill @ 2007-11-27  0:38 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

Hi all,

This patch scripts the pass manager in a way similar to the the
options.c and options.h are generated. It shows no regressions against
the current mainline on x86_64-linux.

Rob

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pass-manager.patch --]
[-- Type: text/x-diff; name=pass-manager.patch, Size: 44925 bytes --]

Index: working/gcc/gcc/cgraph.c
===================================================================
--- working/gcc/gcc/cgraph.c	(revision 130406)
+++ working/gcc/gcc/cgraph.c	(working copy)
@@ -83,6 +83,7 @@
 #include "tree-gimple.h"
 #include "tree-dump.h"
 #include "tree-flow.h"
+#include "passes-defs.h"
 
 static void cgraph_node_remove_callers (struct cgraph_node *node);
 static inline void cgraph_edge_remove_caller (struct cgraph_edge *e);
Index: working/gcc/gcc/tree-pass.h
===================================================================
--- working/gcc/gcc/tree-pass.h	(revision 130406)
+++ working/gcc/gcc/tree-pass.h	(working copy)
@@ -242,218 +242,6 @@
 
 extern void tree_lowering_passes (tree decl);
 
-extern struct tree_opt_pass pass_mudflap_1;
-extern struct tree_opt_pass pass_mudflap_2;
-extern struct tree_opt_pass pass_remove_useless_stmts;
-extern struct tree_opt_pass pass_lower_cf;
-extern struct tree_opt_pass pass_refactor_eh;
-extern struct tree_opt_pass pass_lower_eh;
-extern struct tree_opt_pass pass_build_cfg;
-extern struct tree_opt_pass pass_tree_profile;
-extern struct tree_opt_pass pass_early_tree_profile;
-extern struct tree_opt_pass pass_cleanup_cfg;
-extern struct tree_opt_pass pass_referenced_vars;
-extern struct tree_opt_pass pass_sra;
-extern struct tree_opt_pass pass_sra_early;
-extern struct tree_opt_pass pass_tail_recursion;
-extern struct tree_opt_pass pass_tail_calls;
-extern struct tree_opt_pass pass_tree_loop;
-extern struct tree_opt_pass pass_tree_loop_init;
-extern struct tree_opt_pass pass_lim;
-extern struct tree_opt_pass pass_tree_unswitch;
-extern struct tree_opt_pass pass_predcom;
-extern struct tree_opt_pass pass_iv_canon;
-extern struct tree_opt_pass pass_scev_cprop;
-extern struct tree_opt_pass pass_empty_loop;
-extern struct tree_opt_pass pass_record_bounds;
-extern struct tree_opt_pass pass_if_conversion;
-extern struct tree_opt_pass pass_vectorize;
-extern struct tree_opt_pass pass_complete_unroll;
-extern struct tree_opt_pass pass_parallelize_loops;
-extern struct tree_opt_pass pass_loop_prefetch;
-extern struct tree_opt_pass pass_iv_optimize;
-extern struct tree_opt_pass pass_tree_loop_done;
-extern struct tree_opt_pass pass_ch;
-extern struct tree_opt_pass pass_ccp;
-extern struct tree_opt_pass pass_phi_only_cprop;
-extern struct tree_opt_pass pass_build_ssa;
-extern struct tree_opt_pass pass_del_ssa;
-extern struct tree_opt_pass pass_dominator;
-extern struct tree_opt_pass pass_dce;
-extern struct tree_opt_pass pass_dce_loop;
-extern struct tree_opt_pass pass_cd_dce;
-extern struct tree_opt_pass pass_merge_phi;
-extern struct tree_opt_pass pass_split_crit_edges;
-extern struct tree_opt_pass pass_pre;
-extern struct tree_opt_pass pass_profile;
-extern struct tree_opt_pass pass_lower_complex_O0;
-extern struct tree_opt_pass pass_lower_complex;
-extern struct tree_opt_pass pass_lower_vector;
-extern struct tree_opt_pass pass_lower_vector_ssa;
-extern struct tree_opt_pass pass_lower_omp;
-extern struct tree_opt_pass pass_expand_omp;
-extern struct tree_opt_pass pass_expand_omp_ssa;
-extern struct tree_opt_pass pass_object_sizes;
-extern struct tree_opt_pass pass_fold_builtins;
-extern struct tree_opt_pass pass_stdarg;
-extern struct tree_opt_pass pass_early_warn_uninitialized;
-extern struct tree_opt_pass pass_late_warn_uninitialized;
-extern struct tree_opt_pass pass_cse_reciprocals;
-extern struct tree_opt_pass pass_cse_sincos;
-extern struct tree_opt_pass pass_convert_to_rsqrt;
-extern struct tree_opt_pass pass_warn_function_return;
-extern struct tree_opt_pass pass_warn_function_noreturn;
-extern struct tree_opt_pass pass_cselim;
-extern struct tree_opt_pass pass_phiopt;
-extern struct tree_opt_pass pass_forwprop;
-extern struct tree_opt_pass pass_phiprop;
-extern struct tree_opt_pass pass_tree_ifcombine;
-extern struct tree_opt_pass pass_dse;
-extern struct tree_opt_pass pass_simple_dse;
-extern struct tree_opt_pass pass_nrv;
-extern struct tree_opt_pass pass_mark_used_blocks;
-extern struct tree_opt_pass pass_rename_ssa_copies;
-extern struct tree_opt_pass pass_expand;
-extern struct tree_opt_pass pass_rest_of_compilation;
-extern struct tree_opt_pass pass_sink_code;
-extern struct tree_opt_pass pass_fre;
-extern struct tree_opt_pass pass_linear_transform;
-extern struct tree_opt_pass pass_check_data_deps;
-extern struct tree_opt_pass pass_copy_prop;
-extern struct tree_opt_pass pass_store_ccp;
-extern struct tree_opt_pass pass_vrp;
-extern struct tree_opt_pass pass_create_structure_vars;
-extern struct tree_opt_pass pass_uncprop;
-extern struct tree_opt_pass pass_return_slot;
-extern struct tree_opt_pass pass_reassoc;
-extern struct tree_opt_pass pass_rebuild_cgraph_edges;
-extern struct tree_opt_pass pass_build_cgraph_edges;
-extern struct tree_opt_pass pass_reset_cc_flags;
-
-/* IPA Passes */
-extern struct tree_opt_pass pass_ipa_matrix_reorg;
-extern struct tree_opt_pass pass_ipa_cp;
-extern struct tree_opt_pass pass_ipa_inline;
-extern struct tree_opt_pass pass_ipa_early_inline;
-extern struct tree_opt_pass pass_ipa_reference;
-extern struct tree_opt_pass pass_ipa_pure_const;
-extern struct tree_opt_pass pass_ipa_type_escape;
-extern struct tree_opt_pass pass_ipa_pta;
-extern struct tree_opt_pass pass_ipa_struct_reorg;
-extern struct tree_opt_pass pass_early_local_passes;
-extern struct tree_opt_pass pass_ipa_increase_alignment;
-extern struct tree_opt_pass pass_ipa_function_and_variable_visibility;
-
-extern struct tree_opt_pass pass_all_optimizations;
-extern struct tree_opt_pass pass_cleanup_cfg_post_optimizing;
-extern struct tree_opt_pass pass_free_cfg_annotations;
-extern struct tree_opt_pass pass_free_datastructures;
-extern struct tree_opt_pass pass_init_datastructures;
-extern struct tree_opt_pass pass_fixup_cfg;
-
-extern struct tree_opt_pass pass_init_function;
-extern struct tree_opt_pass pass_jump;
-extern struct tree_opt_pass pass_rtl_eh;
-extern struct tree_opt_pass pass_initial_value_sets;
-extern struct tree_opt_pass pass_unshare_all_rtl;
-extern struct tree_opt_pass pass_instantiate_virtual_regs;
-extern struct tree_opt_pass pass_rtl_fwprop;
-extern struct tree_opt_pass pass_rtl_fwprop_addr;
-extern struct tree_opt_pass pass_jump2;
-extern struct tree_opt_pass pass_lower_subreg;
-extern struct tree_opt_pass pass_cse;
-extern struct tree_opt_pass pass_fast_rtl_dce;
-extern struct tree_opt_pass pass_ud_rtl_dce;
-extern struct tree_opt_pass pass_rtl_dce;
-extern struct tree_opt_pass pass_rtl_dse1;
-extern struct tree_opt_pass pass_rtl_dse2;
-extern struct tree_opt_pass pass_rtl_dse3;
-extern struct tree_opt_pass pass_gcse;
-extern struct tree_opt_pass pass_jump_bypass;
-extern struct tree_opt_pass pass_profiling;
-extern struct tree_opt_pass pass_rtl_ifcvt;
-extern struct tree_opt_pass pass_tracer;
-
-extern struct tree_opt_pass pass_into_cfg_layout_mode;
-extern struct tree_opt_pass pass_outof_cfg_layout_mode;
-
-extern struct tree_opt_pass pass_loop2;
-extern struct tree_opt_pass pass_rtl_loop_init;
-extern struct tree_opt_pass pass_rtl_move_loop_invariants;
-extern struct tree_opt_pass pass_rtl_unswitch;
-extern struct tree_opt_pass pass_rtl_unroll_and_peel_loops;
-extern struct tree_opt_pass pass_rtl_doloop;
-extern struct tree_opt_pass pass_rtl_loop_done;
-
-extern struct tree_opt_pass pass_web;
-extern struct tree_opt_pass pass_cse2;
-extern struct tree_opt_pass pass_df_initialize_opt;
-extern struct tree_opt_pass pass_df_initialize_no_opt;
-extern struct tree_opt_pass pass_regclass_init;
-extern struct tree_opt_pass pass_subregs_of_mode_init;
-extern struct tree_opt_pass pass_subregs_of_mode_finish;
-extern struct tree_opt_pass pass_inc_dec;
-extern struct tree_opt_pass pass_stack_ptr_mod;
-extern struct tree_opt_pass pass_initialize_regs;
-extern struct tree_opt_pass pass_combine;
-extern struct tree_opt_pass pass_if_after_combine;
-extern struct tree_opt_pass pass_partition_blocks;
-extern struct tree_opt_pass pass_match_asm_constraints;
-extern struct tree_opt_pass pass_regmove;
-extern struct tree_opt_pass pass_split_all_insns;
-extern struct tree_opt_pass pass_lower_subreg2;
-extern struct tree_opt_pass pass_mode_switching;
-extern struct tree_opt_pass pass_see;
-extern struct tree_opt_pass pass_sms;
-extern struct tree_opt_pass pass_sched;
-extern struct tree_opt_pass pass_local_alloc;
-extern struct tree_opt_pass pass_global_alloc;
-extern struct tree_opt_pass pass_postreload;
-extern struct tree_opt_pass pass_clean_state;
-extern struct tree_opt_pass pass_branch_prob;
-extern struct tree_opt_pass pass_value_profile_transformations;
-extern struct tree_opt_pass pass_postreload_cse;
-extern struct tree_opt_pass pass_gcse2;
-extern struct tree_opt_pass pass_split_after_reload;
-extern struct tree_opt_pass pass_branch_target_load_optimize1;
-extern struct tree_opt_pass pass_thread_prologue_and_epilogue;
-extern struct tree_opt_pass pass_stack_adjustments;
-extern struct tree_opt_pass pass_peephole2;
-extern struct tree_opt_pass pass_if_after_reload;
-extern struct tree_opt_pass pass_regrename;
-extern struct tree_opt_pass pass_cprop_hardreg;
-extern struct tree_opt_pass pass_reorder_blocks;
-extern struct tree_opt_pass pass_branch_target_load_optimize2;
-extern struct tree_opt_pass pass_leaf_regs;
-extern struct tree_opt_pass pass_split_before_sched2;
-extern struct tree_opt_pass pass_sched2;
-extern struct tree_opt_pass pass_stack_regs;
-extern struct tree_opt_pass pass_stack_regs_run;
-extern struct tree_opt_pass pass_df_finish;
-extern struct tree_opt_pass pass_compute_alignments;
-extern struct tree_opt_pass pass_duplicate_computed_gotos;
-extern struct tree_opt_pass pass_variable_tracking;
-extern struct tree_opt_pass pass_free_cfg;
-extern struct tree_opt_pass pass_machine_reorg;
-extern struct tree_opt_pass pass_cleanup_barriers;
-extern struct tree_opt_pass pass_delay_slots;
-extern struct tree_opt_pass pass_split_for_shorten_branches;
-extern struct tree_opt_pass pass_split_before_regstack;
-extern struct tree_opt_pass pass_convert_to_eh_region_ranges;
-extern struct tree_opt_pass pass_shorten_branches;
-extern struct tree_opt_pass pass_set_nothrow_function_flags;
-extern struct tree_opt_pass pass_final;
-extern struct tree_opt_pass pass_rtl_seqabstr;
-extern struct tree_opt_pass pass_release_ssa_names;
-extern struct tree_opt_pass pass_early_inline;
-extern struct tree_opt_pass pass_inline_parameters;
-extern struct tree_opt_pass pass_apply_inline;
-extern struct tree_opt_pass pass_all_early_optimizations;
-extern struct tree_opt_pass pass_update_address_taken;
-
-/* The root of the compilation pass tree, once constructed.  */
-extern struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
-
 extern void execute_pass_list (struct tree_opt_pass *);
 extern void execute_ipa_pass_list (struct tree_opt_pass *);
 extern void print_current_pass (FILE *);
Index: working/gcc/gcc/passes-c.awk
===================================================================
--- working/gcc/gcc/passes-c.awk	(revision 0)
+++ working/gcc/gcc/passes-c.awk	(revision 0)
@@ -0,0 +1,119 @@
+#  Copyright (C) 2007 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3, or (at your option) any
+# later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# This Awk script reads in the option records generated from 
+# opt-gather.awk, combines the flags of duplicat options and generates a
+# C file.
+#
+# Usage: awk -f passes-c.awk passes.def > passes-defs.c
+
+func indent(nesting_depth)
+{
+	string = ""
+
+	while(nesting_depth > 0)
+	{
+		string = sprintf("  %s", string);
+		nesting_depth--;
+	}
+
+	return string;
+}
+
+BEGIN {
+	nesting_depth = 0
+	previous_line = ""
+
+	print "#include \"system.h\""
+	print "#include \"coretypes.h\""
+	print "#include \"tree-pass.h\""
+	print "#include \"passes.h\""
+	print "#include \"passes-defs.h\"\n"	
+	print "void\ninit_optimization_passes (void)"
+	print "{"
+	print indent(1) "struct tree_opt_pass **p;\n"
+	print indent(1) "#define NEXT_PASS(PASS)  (p = next_pass_1 (p, &PASS))\n"
+}
+
+# Print out the pass list
+{
+	if ($1 == "#" || $1 == "")
+	{
+		next # Ignore comments and blank lines
+	}
+	else if ($1 == "{")
+	{
+		if(nesting_depth > 0)
+		{
+			indent_string = indent(nesting_depth);
+			print indent_string "{"
+			print indent_string "  struct tree_opt_pass **p = &" previous_line ".sub;";
+		}
+		else
+		{	
+			print "  p = &" previous_line ";"
+		}
+
+		nesting_depth++;
+	}
+	else if($1 == "}")
+	{
+		if(nesting_depth > 1)
+		{
+			nesting_depth--;
+			indent_string = indent(nesting_depth);
+			print indent_string "}";
+		}
+		else
+		{
+			print "  *p = NULL;\n\n"
+			nesting_depth--;
+		}
+	}
+	else
+	{
+		# Record this line, in case the next line contains
+		# an opening brace.
+		previous_line = $1;
+
+		# Only make it a pass if the nesting_depth is > 0
+		if(nesting_depth > 0)
+		{
+			indent_string = indent(nesting_depth);
+			print indent_string "NEXT_PASS (" $1 ");";
+		}
+	}
+}
+
+END {
+
+print "#undef NEXT_PASS\n"
+
+indent_string = indent(1);
+
+# Register the passes with the tree dump code.
+print indent_string "register_dump_files (all_lowering_passes, false, PROP_gimple_any);"
+print indent_string "all_lowering_passes->todo_flags_start |= TODO_set_props; "
+print indent_string "register_dump_files (all_ipa_passes, true,\n\
+		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh \n\
+		       | PROP_cfg);"
+print indent_string "register_dump_files (all_passes, false,\n\
+		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh\n\
+		       | PROP_cfg);"
+
+# Print the final closing brace
+print "}"
+}
Index: working/gcc/gcc/cgraphunit.c
===================================================================
--- working/gcc/gcc/cgraphunit.c	(revision 130406)
+++ working/gcc/gcc/cgraphunit.c	(working copy)
@@ -149,6 +149,7 @@
 #include "ipa-prop.h"
 #include "tree-gimple.h"
 #include "tree-pass.h"
+#include "passes-defs.h"
 #include "output.h"
 
 static void cgraph_expand_all_functions (void);
Index: working/gcc/gcc/passes.def
===================================================================
--- working/gcc/gcc/passes.def	(revision 0)
+++ working/gcc/gcc/passes.def	(revision 0)
@@ -0,0 +1,350 @@
+# This file contains definitions of the passes to be performed by
+# the compiler.
+
+#   Copyright (C) 2007 Free Software Foundation, Inc.
+
+# This file is part of GCC.
+
+# GCC is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3, or (at your option) any later
+# version.
+
+# GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+
+# Define the structure of the passes
+
+# The sequencing of passes is driven by
+# the cgraph routines:
+
+# cgraph_finalize_compilation_unit ()
+#      for each node N in the cgraph
+#	   cgraph_analyze_function (N)
+#	       cgraph_lower_function (N) -> all_lowering_passes
+
+#  If we are optimizing, cgraph_optimize is then invoked:
+
+#  cgraph_optimize ()
+#      ipa_passes () 			-> all_ipa_passes
+#      cgraph_expand_all_functions ()
+#          for each node N in the cgraph
+#	       cgraph_expand_function (N)
+#		  tree_rest_of_compilation (DECL (N))  -> all_passes
+
+# All passes needed to lower the function into shape optimizers can
+# operate on.  These passes are always run first on the function, but
+# backend might produce already lowered functions that are not processed
+# by these passes. 
+
+all_lowering_passes
+{
+  pass_remove_useless_stmts 
+  pass_mudflap_1
+  pass_lower_omp
+  pass_lower_cf
+  pass_refactor_eh
+  pass_lower_eh
+  pass_build_cfg
+  pass_lower_complex_O0
+  pass_lower_vector
+  pass_warn_function_return
+  pass_build_cgraph_edges
+  pass_inline_parameters
+}
+
+# Interprocedural optimization passes. 
+# All these passes are ignored in -fno-unit-at-a-time
+# except for subpasses of early_local_passes. 
+
+all_ipa_passes
+{
+  pass_ipa_function_and_variable_visibility
+  pass_ipa_early_inline
+  {
+    pass_early_inline
+    pass_inline_parameters
+    pass_rebuild_cgraph_edges
+  }
+  pass_early_local_passes
+  {
+    pass_tree_profile
+    pass_cleanup_cfg
+    pass_init_datastructures
+    pass_expand_omp
+    pass_all_early_optimizations
+    {
+      pass_referenced_vars
+      pass_reset_cc_flags
+      pass_build_ssa
+      pass_expand_omp_ssa
+      pass_early_warn_uninitialized
+      pass_rebuild_cgraph_edges
+      pass_early_inline
+      pass_cleanup_cfg
+      pass_rename_ssa_copies
+      pass_ccp
+      pass_forwprop
+      pass_update_address_taken
+      pass_simple_dse
+      pass_sra_early
+      pass_copy_prop
+      pass_merge_phi
+      pass_dce
+      pass_update_address_taken
+      pass_simple_dse
+      pass_tail_recursion
+      pass_profile
+      pass_release_ssa_names
+    }
+    pass_rebuild_cgraph_edges
+    pass_inline_parameters
+  }
+  pass_ipa_increase_alignment
+  pass_ipa_matrix_reorg
+  pass_ipa_cp
+  pass_ipa_inline
+  pass_ipa_reference
+  pass_ipa_pure_const
+  pass_ipa_type_escape
+  pass_ipa_pta
+  pass_ipa_struct_reorg
+}
+
+# These passes are run after IPA passes on every function that is being
+# output to the assembler file.
+all_passes
+{
+  pass_apply_inline
+  pass_all_optimizations
+  {
+    pass_create_structure_vars
+    pass_return_slot
+    pass_rename_ssa_copies
+
+    # Initial scalar cleanups.
+    pass_ccp
+    pass_phiprop
+    pass_fre
+    pass_dce
+    pass_forwprop
+    pass_copy_prop
+    pass_merge_phi
+    pass_vrp
+    pass_dce
+    pass_cselim
+    pass_dominator
+
+    # The only const/copy propagation opportunities left after
+    # DOM should be due to degenerate PHI nodes.  So rather than
+    # run the full propagators, run a specialized pass which
+    # only examines PHIs to discover const/copy propagation
+    # opportunities.
+
+    pass_phi_only_cprop
+    pass_tree_ifcombine
+    pass_phiopt
+    pass_tail_recursion
+    pass_ch
+    pass_stdarg
+    pass_lower_complex
+    pass_sra
+    pass_rename_ssa_copies
+    pass_dominator
+
+    # The only const/copy propagation opportunities left after
+    # DOM should be due to degenerate PHI nodes.  So rather than
+    # run the full propagators, run a specialized pass which
+    # only examines PHIs to discover const/copy propagation
+    # opportunities.
+
+    pass_phi_only_cprop
+
+    pass_reassoc
+    pass_dce
+    pass_dse
+    pass_forwprop
+    pass_phiopt
+    pass_object_sizes
+    pass_store_ccp
+    pass_copy_prop
+    pass_fold_builtins
+    pass_cse_sincos
+    pass_split_crit_edges
+    pass_pre
+    pass_sink_code
+    pass_tree_loop
+    {
+      pass_tree_loop_init
+      pass_copy_prop
+      pass_dce_loop
+      pass_lim
+      pass_predcom
+      pass_tree_unswitch
+      pass_scev_cprop
+      pass_empty_loop
+      pass_record_bounds
+      pass_check_data_deps
+      pass_linear_transform
+      pass_iv_canon
+      pass_if_conversion
+      pass_vectorize
+      {
+        pass_lower_vector_ssa
+        pass_dce_loop
+      }
+      pass_complete_unroll
+      pass_parallelize_loops
+      pass_loop_prefetch
+      pass_iv_optimize
+      pass_tree_loop_done
+    }
+    pass_cse_reciprocals
+    pass_convert_to_rsqrt
+    pass_reassoc
+    pass_vrp
+    pass_dominator
+      
+    # The only const/copy propagation opportunities left after
+    # DOM should be due to degenerate PHI nodes.  So rather than
+    # run the full propagators, run a specialized pass which
+    # only examines PHIs to discover const/copy propagation
+    # opportunities.
+
+    pass_phi_only_cprop
+
+    pass_cd_dce
+    pass_tracer
+
+    # FIXME: If DCE is not run before checking for uninitialized uses,
+    # we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
+    # However, this also causes us to misdiagnose cases that should be
+    # real warnings (e.g., testsuite/gcc.dg/pr18501.c).
+	 
+    # To fix the false positives in uninit-5.c, we would have to
+    # account for the predicates protecting the set and the use of each
+    # variable.  Using a representation like Gated Single Assignment
+    # may help.
+
+    pass_late_warn_uninitialized
+    pass_dse
+    pass_forwprop
+    pass_phiopt
+    pass_tail_calls
+    pass_rename_ssa_copies
+    pass_uncprop
+    pass_del_ssa
+    pass_nrv
+    pass_mark_used_blocks
+    pass_cleanup_cfg_post_optimizing
+  }
+  pass_warn_function_noreturn
+  pass_free_datastructures
+  pass_mudflap_2
+  pass_free_cfg_annotations
+  pass_expand
+  pass_rest_of_compilation
+  {
+    pass_init_function
+    pass_jump
+    pass_rtl_eh
+    pass_initial_value_sets
+    pass_unshare_all_rtl
+    pass_instantiate_virtual_regs
+    pass_into_cfg_layout_mode
+    pass_jump2
+    pass_lower_subreg
+    pass_df_initialize_opt
+    pass_cse
+    pass_rtl_fwprop
+    pass_gcse
+    pass_rtl_ifcvt
+    
+    # Perform loop optimizations.  It might be better to do them a bit
+    # sooner, but we want the profile feedback to work more
+    # efficiently.
+    pass_loop2
+	{
+      pass_rtl_loop_init
+      pass_rtl_move_loop_invariants
+      pass_rtl_unswitch
+      pass_rtl_unroll_and_peel_loops
+      pass_rtl_doloop
+      pass_rtl_loop_done
+	}
+    pass_web
+    pass_jump_bypass
+    pass_cse2
+    pass_rtl_dse1
+    pass_rtl_fwprop_addr
+    pass_regclass_init
+    pass_inc_dec
+    pass_initialize_regs
+    pass_outof_cfg_layout_mode
+    pass_ud_rtl_dce
+    pass_combine
+    pass_if_after_combine
+    pass_partition_blocks
+    pass_regmove
+    pass_split_all_insns
+    pass_lower_subreg2
+    pass_df_initialize_no_opt
+    pass_stack_ptr_mod
+    pass_mode_switching
+    pass_see
+    pass_match_asm_constraints
+    pass_sms
+    pass_sched
+    pass_subregs_of_mode_init
+    pass_local_alloc
+    pass_global_alloc
+    pass_subregs_of_mode_finish
+    pass_postreload
+    {
+      pass_postreload_cse
+      pass_gcse2
+      pass_split_after_reload
+      pass_branch_target_load_optimize1
+      pass_thread_prologue_and_epilogue
+      pass_rtl_dse2
+      pass_rtl_seqabstr
+      pass_stack_adjustments
+      pass_peephole2
+      pass_if_after_reload
+      pass_regrename
+      pass_cprop_hardreg
+      pass_fast_rtl_dce
+      pass_reorder_blocks
+      pass_branch_target_load_optimize2
+      pass_leaf_regs
+      pass_split_before_sched2
+      pass_sched2
+      pass_stack_regs
+      {
+        pass_split_before_regstack
+        pass_stack_regs_run
+      }
+      pass_compute_alignments
+      pass_duplicate_computed_gotos
+      pass_variable_tracking
+      pass_free_cfg
+      pass_machine_reorg
+      pass_cleanup_barriers
+      pass_delay_slots
+      pass_split_for_shorten_branches
+      pass_convert_to_eh_region_ranges
+      pass_shorten_branches
+      pass_set_nothrow_function_flags
+      pass_final
+    }
+    pass_df_finish
+  }
+  pass_clean_state
+}
Index: working/gcc/gcc/global.c
===================================================================
--- working/gcc/gcc/global.c	(revision 130406)
+++ working/gcc/gcc/global.c	(working copy)
@@ -37,6 +37,7 @@
 #include "output.h"
 #include "toplev.h"
 #include "tree-pass.h"
+#include "passes-defs.h"
 #include "timevar.h"
 #include "df.h"
 #include "vecprim.h"
Index: working/gcc/gcc/tree-optimize.c
===================================================================
--- working/gcc/gcc/tree-optimize.c	(revision 130406)
+++ working/gcc/gcc/tree-optimize.c	(working copy)
@@ -48,6 +48,7 @@
 #include "graph.h"
 #include "cfgloop.h"
 #include "except.h"
+#include "passes-defs.h"
 
 
 /* Gate: execute, or not, all of the non-trivial optimizations.  */
Index: working/gcc/gcc/passes-h.awk
===================================================================
--- working/gcc/gcc/passes-h.awk	(revision 0)
+++ working/gcc/gcc/passes-h.awk	(revision 0)
@@ -0,0 +1,87 @@
+#  Copyright (C) 2007 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3, or (at your option) any
+# later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# This Awk script reads in the option records generated from 
+# opt-gather.awk, combines the flags of duplicat options and generates a
+# C file.
+#
+# Usage: awk -f passes-h.awk passes.def > passes-defs.h
+
+BEGIN {
+	nesting_depth = 0
+	previous_line = ""
+	pass_tree_roots = ""
+	root_node_count = 0;
+
+	print  "#ifndef GCC_PASSES_DEFS_H"
+	print "#define GCC_PASSES_DEFS_H 1\n"
+
+	print "#include \"tree-pass.h\"\n"
+}
+
+# Print out the pass list
+{
+	if ($1 == "#" || $1 == "")
+	{
+		next # Ignore comments and blank lines
+	}
+	else if ($1 == "{")
+	{
+		# If we are at the top level then the lines preceeding a
+		# brace are the nodes which will be the root of the
+		# compilation tree.
+		if(nesting_depth == 0)
+		{	
+			# If this is not the first one then add a comma before appending
+			if(pass_root_count > 0)
+			{
+				pass_tree_roots = sprintf("%s, ", pass_tree_roots);
+			}
+			
+			pass_tree_roots = sprintf("%s*%s", pass_tree_roots, previous_line);
+
+			pass_root_count++;
+		}
+
+		nesting_depth++;
+	}
+	else if($1 == "}")
+	{
+		nesting_depth--;
+	}
+	else
+	{
+		# Record this line, in case the next line contains
+		# an opening brace.
+		previous_line = $1;
+
+		if(nesting_depth > 0)
+		{
+			print "extern struct tree_opt_pass " $1 ";"
+		}
+	}
+}
+
+END {
+
+	print "\n";
+	print "extern struct tree_opt_pass " pass_tree_roots ";\n"
+
+	# Declare some functions from passes.c
+	print "struct tree_opt_pass **next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass);\n"
+
+	print "#endif"
+}
Index: working/gcc/gcc/Makefile.in
===================================================================
--- working/gcc/gcc/Makefile.in	(revision 130406)
+++ working/gcc/gcc/Makefile.in	(working copy)
@@ -1094,6 +1094,7 @@
 	opts.o \
 	params.o \
 	passes.o \
+	passes-defs.o \
 	pointer-set.o \
 	postreload-gcse.o \
 	postreload.o \
@@ -2214,7 +2215,7 @@
    $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \
    $(FLAGS_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) toplev.h \
    $(FUNCTION_H) langhooks.h $(FLAGS_H) $(CGRAPH_H) $(TREE_INLINE_H) \
-   tree-mudflap.h $(GGC_H) $(CGRAPH_H) tree-pass.h $(CFGLOOP_H) \
+   tree-mudflap.h $(GGC_H) $(CGRAPH_H) tree-pass.h passes-defs.h $(CFGLOOP_H) \
    $(BASIC_BLOCK_H) graph.h hard-reg-set.h
 c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
    $(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(VARRAY_H) \
@@ -2333,6 +2334,15 @@
 	  -DTARGET_NAME=\"$(target_noncanonical)\" \
 	  -c $(srcdir)/toplev.c $(OUTPUT_OPTION)
 
+passes-defs.o : passes-defs.c passes-defs.h
+	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(OUTPUT_OPTION) -c passes-defs.c
+
+passes-defs.c : $(srcdir)/passes.def $(srcdir)/passes-c.awk passes-defs.h
+	$(AWK) -f $(srcdir)/passes-c.awk  < $< > $@
+
+passes-defs.h : $(srcdir)/passes.def $(srcdir)/passes-h.awk
+	$(AWK) -f $(srcdir)/passes-h.awk  < $< > $@
+
 passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    $(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h input.h $(INSN_ATTR_H) output.h \
    $(DIAGNOSTIC_H) debug.h insn-config.h intl.h $(RECOG_H) toplev.h \
@@ -2340,9 +2350,9 @@
    graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \
    $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
    langhooks.h insn-flags.h $(CFGLAYOUT_H) $(REAL_H) $(CFGLOOP_H) \
-   hosthooks.h $(CGRAPH_H) $(COVERAGE_H) tree-pass.h $(TREE_DUMP_H) \
+   hosthooks.h $(CGRAPH_H) $(COVERAGE_H) tree-pass.h passes-defs.h $(TREE_DUMP_H) \
    $(GGC_H) $(INTEGRATE_H) $(CPPLIB_H) opts.h $(TREE_FLOW_H) $(TREE_INLINE_H) \
-   gt-passes.h $(DF_H) $(PREDICT_H)
+   gt-passes.h $(DF_H) $(PREDICT_H) passes.h
 
 main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h
 
@@ -2468,13 +2478,13 @@
 cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    langhooks.h toplev.h $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \
    gt-cgraph.h output.h intl.h $(BASIC_BLOCK_H) debug.h $(HASHTAB_H) \
-   $(TREE_INLINE_H) $(VARRAY_H) $(TREE_DUMP_H) $(TREE_FLOW_H)
+   $(TREE_INLINE_H) $(VARRAY_H) $(TREE_DUMP_H) $(TREE_FLOW_H) passes-defs.h
 cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TREE_H) langhooks.h $(TREE_INLINE_H) toplev.h $(FLAGS_H) $(GGC_H) \
    $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(TREE_GIMPLE_H) \
    $(TREE_FLOW_H) tree-pass.h $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \
    $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) ipa-prop.h \
-   gt-cgraphunit.h 
+   gt-cgraphunit.h  passes-defs.h
 cgraphbuild.o : cgraphbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TREE_H) langhooks.h $(CGRAPH_H) intl.h pointer-set.h $(TREE_GIMPLE_H) \
    $(TREE_FLOW_H) tree-pass.h
@@ -2713,7 +2723,7 @@
 global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \
    insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \
-   $(TIMEVAR_H) vecprim.h $(DF_H) $(DBGCNT_H) $(RA_H)
+   $(TIMEVAR_H) vecprim.h $(DF_H) $(DBGCNT_H) $(RA_H) passes-defs.h
 ra-conflict.o : ra-conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \
    insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \
Index: working/gcc/gcc/passes.c
===================================================================
--- working/gcc/gcc/passes.c	(revision 130406)
+++ working/gcc/gcc/passes.c	(working copy)
@@ -84,6 +84,8 @@
 #include "tree-dump.h"
 #include "df.h"
 #include "predict.h"
+#include "passes-defs.h"
+#include "passes.h"
 
 #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
 #include "dwarf2out.h"
@@ -397,7 +399,7 @@
    properties that are guaranteed to be available at the beginning of
    the pipeline.  */
 
-static void 
+void
 register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
 {
   pass->properties_required |= properties;
@@ -407,7 +409,7 @@
 /* Add a pass to the pass list. Duplicate the pass if it's already
    in the list.  */
 
-static struct tree_opt_pass **
+struct tree_opt_pass **
 next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
 {
   /* A nonzero static_pass_number indicates that the
@@ -446,354 +448,9 @@
 }
 
 
-/* Construct the pass tree.  The sequencing of passes is driven by
-   the cgraph routines:
 
-   cgraph_finalize_compilation_unit ()
-       for each node N in the cgraph
-	   cgraph_analyze_function (N)
-	       cgraph_lower_function (N) -> all_lowering_passes
 
-   If we are optimizing, cgraph_optimize is then invoked:
 
-   cgraph_optimize ()
-       ipa_passes () 			-> all_ipa_passes
-       cgraph_expand_all_functions ()
-           for each node N in the cgraph
-	       cgraph_expand_function (N)
-		  tree_rest_of_compilation (DECL (N))  -> all_passes
-*/
-
-void
-init_optimization_passes (void)
-{
-  struct tree_opt_pass **p;
-
-#define NEXT_PASS(PASS)  (p = next_pass_1 (p, &PASS))
-
- /* All passes needed to lower the function into shape optimizers can
-    operate on.  These passes are always run first on the function, but
-    backend might produce already lowered functions that are not processed
-    by these passes.  */
-  p = &all_lowering_passes;
-  NEXT_PASS (pass_remove_useless_stmts);
-  NEXT_PASS (pass_mudflap_1);
-  NEXT_PASS (pass_lower_omp);
-  NEXT_PASS (pass_lower_cf);
-  NEXT_PASS (pass_refactor_eh);
-  NEXT_PASS (pass_lower_eh);
-  NEXT_PASS (pass_build_cfg);
-  NEXT_PASS (pass_lower_complex_O0);
-  NEXT_PASS (pass_lower_vector);
-  NEXT_PASS (pass_warn_function_return);
-  NEXT_PASS (pass_build_cgraph_edges);
-  NEXT_PASS (pass_inline_parameters);
-  *p = NULL;
-
-  /* Interprocedural optimization passes. 
-     All these passes are ignored in -fno-unit-at-a-time
-     except for subpasses of early_local_passes.  */
-  p = &all_ipa_passes;
-  NEXT_PASS (pass_ipa_function_and_variable_visibility);
-  NEXT_PASS (pass_ipa_early_inline);
-    {
-      struct tree_opt_pass **p = &pass_ipa_early_inline.sub;
-      NEXT_PASS (pass_early_inline);
-      NEXT_PASS (pass_inline_parameters);
-      NEXT_PASS (pass_rebuild_cgraph_edges);
-    }
-  NEXT_PASS (pass_early_local_passes);
-    {
-      struct tree_opt_pass **p = &pass_early_local_passes.sub;
-      NEXT_PASS (pass_tree_profile);
-      NEXT_PASS (pass_cleanup_cfg);
-      NEXT_PASS (pass_init_datastructures);
-      NEXT_PASS (pass_expand_omp);
-      NEXT_PASS (pass_all_early_optimizations);
-	{
-	  struct tree_opt_pass **p = &pass_all_early_optimizations.sub;
-	  NEXT_PASS (pass_referenced_vars);
-	  NEXT_PASS (pass_reset_cc_flags);
-	  NEXT_PASS (pass_build_ssa);
-	  NEXT_PASS (pass_expand_omp_ssa);
-	  NEXT_PASS (pass_early_warn_uninitialized);
-	  NEXT_PASS (pass_rebuild_cgraph_edges);
-	  NEXT_PASS (pass_early_inline);
-	  NEXT_PASS (pass_cleanup_cfg);
-	  NEXT_PASS (pass_rename_ssa_copies);
-	  NEXT_PASS (pass_ccp);
-	  NEXT_PASS (pass_forwprop);
-	  NEXT_PASS (pass_update_address_taken);
-	  NEXT_PASS (pass_simple_dse);
-	  NEXT_PASS (pass_sra_early);
-	  NEXT_PASS (pass_copy_prop);
-	  NEXT_PASS (pass_merge_phi);
-	  NEXT_PASS (pass_dce);
-	  NEXT_PASS (pass_update_address_taken);
-	  NEXT_PASS (pass_simple_dse);
-	  NEXT_PASS (pass_tail_recursion);
-          NEXT_PASS (pass_profile);
-	  NEXT_PASS (pass_release_ssa_names);
-	}
-      NEXT_PASS (pass_rebuild_cgraph_edges);
-      NEXT_PASS (pass_inline_parameters);
-    }
-  NEXT_PASS (pass_ipa_increase_alignment);
-  NEXT_PASS (pass_ipa_matrix_reorg);
-  NEXT_PASS (pass_ipa_cp);
-  NEXT_PASS (pass_ipa_inline);
-  NEXT_PASS (pass_ipa_reference);
-  NEXT_PASS (pass_ipa_pure_const); 
-  NEXT_PASS (pass_ipa_type_escape);
-  NEXT_PASS (pass_ipa_pta);
-  NEXT_PASS (pass_ipa_struct_reorg);  
-  *p = NULL;
-
-  /* These passes are run after IPA passes on every function that is being
-     output to the assembler file.  */
-  p = &all_passes;
-  NEXT_PASS (pass_apply_inline);
-  NEXT_PASS (pass_all_optimizations);
-    {
-      struct tree_opt_pass **p = &pass_all_optimizations.sub;
-      NEXT_PASS (pass_create_structure_vars);
-      NEXT_PASS (pass_return_slot);
-      NEXT_PASS (pass_rename_ssa_copies);
-
-      /* Initial scalar cleanups.  */
-      NEXT_PASS (pass_ccp);
-      NEXT_PASS (pass_phiprop);
-      NEXT_PASS (pass_fre);
-      NEXT_PASS (pass_dce);
-      NEXT_PASS (pass_forwprop);
-      NEXT_PASS (pass_copy_prop);
-      NEXT_PASS (pass_merge_phi);
-      NEXT_PASS (pass_vrp);
-      NEXT_PASS (pass_dce);
-      NEXT_PASS (pass_cselim);
-      NEXT_PASS (pass_dominator);
-      /* The only const/copy propagation opportunities left after
-	 DOM should be due to degenerate PHI nodes.  So rather than
-	 run the full propagators, run a specialized pass which
-	 only examines PHIs to discover const/copy propagation
-	 opportunities.  */
-      NEXT_PASS (pass_phi_only_cprop);
-      NEXT_PASS (pass_tree_ifcombine);
-      NEXT_PASS (pass_phiopt);
-      NEXT_PASS (pass_tail_recursion);
-      NEXT_PASS (pass_ch);
-      NEXT_PASS (pass_stdarg);
-      NEXT_PASS (pass_lower_complex);
-      NEXT_PASS (pass_sra);
-      NEXT_PASS (pass_rename_ssa_copies);
-      NEXT_PASS (pass_dominator);
-
-      /* The only const/copy propagation opportunities left after
-	 DOM should be due to degenerate PHI nodes.  So rather than
-	 run the full propagators, run a specialized pass which
-	 only examines PHIs to discover const/copy propagation
-	 opportunities.  */
-      NEXT_PASS (pass_phi_only_cprop);
-
-      NEXT_PASS (pass_reassoc);
-      NEXT_PASS (pass_dce);
-      NEXT_PASS (pass_dse);
-      NEXT_PASS (pass_forwprop);
-      NEXT_PASS (pass_phiopt);
-      NEXT_PASS (pass_object_sizes);
-      NEXT_PASS (pass_store_ccp);
-      NEXT_PASS (pass_copy_prop);
-      NEXT_PASS (pass_fold_builtins);
-      NEXT_PASS (pass_cse_sincos);
-      NEXT_PASS (pass_split_crit_edges);
-      NEXT_PASS (pass_pre);
-      NEXT_PASS (pass_sink_code);
-      NEXT_PASS (pass_tree_loop);
-	{
-	  struct tree_opt_pass **p = &pass_tree_loop.sub;
-	  NEXT_PASS (pass_tree_loop_init);
-	  NEXT_PASS (pass_copy_prop);
-	  NEXT_PASS (pass_dce_loop);
-	  NEXT_PASS (pass_lim);
-	  NEXT_PASS (pass_predcom);
-	  NEXT_PASS (pass_tree_unswitch);
-	  NEXT_PASS (pass_scev_cprop);
-	  NEXT_PASS (pass_empty_loop);
-	  NEXT_PASS (pass_record_bounds);
-	  NEXT_PASS (pass_check_data_deps);
-	  NEXT_PASS (pass_linear_transform);
-	  NEXT_PASS (pass_iv_canon);
-	  NEXT_PASS (pass_if_conversion);
-	  NEXT_PASS (pass_vectorize);
-	    {
-	      struct tree_opt_pass **p = &pass_vectorize.sub;
-	      NEXT_PASS (pass_lower_vector_ssa);
-	      NEXT_PASS (pass_dce_loop);
-	    }
-	  NEXT_PASS (pass_complete_unroll);
-	  NEXT_PASS (pass_parallelize_loops);
-	  NEXT_PASS (pass_loop_prefetch);
-	  NEXT_PASS (pass_iv_optimize);
-	  NEXT_PASS (pass_tree_loop_done);
-	}
-      NEXT_PASS (pass_cse_reciprocals);
-      NEXT_PASS (pass_convert_to_rsqrt);
-      NEXT_PASS (pass_reassoc);
-      NEXT_PASS (pass_vrp);
-      NEXT_PASS (pass_dominator);
-      
-      /* The only const/copy propagation opportunities left after
-	 DOM should be due to degenerate PHI nodes.  So rather than
-	 run the full propagators, run a specialized pass which
-	 only examines PHIs to discover const/copy propagation
-	 opportunities.  */
-      NEXT_PASS (pass_phi_only_cprop);
-
-      NEXT_PASS (pass_cd_dce);
-      NEXT_PASS (pass_tracer);
-
-      /* FIXME: If DCE is not run before checking for uninitialized uses,
-	 we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
-	 However, this also causes us to misdiagnose cases that should be
-	 real warnings (e.g., testsuite/gcc.dg/pr18501.c).
-	 
-	 To fix the false positives in uninit-5.c, we would have to
-	 account for the predicates protecting the set and the use of each
-	 variable.  Using a representation like Gated Single Assignment
-	 may help.  */
-      NEXT_PASS (pass_late_warn_uninitialized);
-      NEXT_PASS (pass_dse);
-      NEXT_PASS (pass_forwprop);
-      NEXT_PASS (pass_phiopt);
-      NEXT_PASS (pass_tail_calls);
-      NEXT_PASS (pass_rename_ssa_copies);
-      NEXT_PASS (pass_uncprop);
-      NEXT_PASS (pass_del_ssa);
-      NEXT_PASS (pass_nrv);
-      NEXT_PASS (pass_mark_used_blocks);
-      NEXT_PASS (pass_cleanup_cfg_post_optimizing);
-    }
-  NEXT_PASS (pass_warn_function_noreturn);
-  NEXT_PASS (pass_free_datastructures);
-  NEXT_PASS (pass_mudflap_2);
-  NEXT_PASS (pass_free_cfg_annotations);
-  NEXT_PASS (pass_expand);
-  NEXT_PASS (pass_rest_of_compilation);
-    {
-      struct tree_opt_pass **p = &pass_rest_of_compilation.sub;
-      NEXT_PASS (pass_init_function);
-      NEXT_PASS (pass_jump);
-      NEXT_PASS (pass_rtl_eh);
-      NEXT_PASS (pass_initial_value_sets);
-      NEXT_PASS (pass_unshare_all_rtl);
-      NEXT_PASS (pass_instantiate_virtual_regs);
-      NEXT_PASS (pass_into_cfg_layout_mode);
-      NEXT_PASS (pass_jump2);
-      NEXT_PASS (pass_lower_subreg);
-      NEXT_PASS (pass_df_initialize_opt);
-      NEXT_PASS (pass_cse);
-      NEXT_PASS (pass_rtl_fwprop);
-      NEXT_PASS (pass_gcse);
-      NEXT_PASS (pass_rtl_ifcvt);
-      /* Perform loop optimizations.  It might be better to do them a bit
-	 sooner, but we want the profile feedback to work more
-	 efficiently.  */
-      NEXT_PASS (pass_loop2);
-	{
-	  struct tree_opt_pass **p = &pass_loop2.sub;
-	  NEXT_PASS (pass_rtl_loop_init);
-	  NEXT_PASS (pass_rtl_move_loop_invariants);
-	  NEXT_PASS (pass_rtl_unswitch);
-	  NEXT_PASS (pass_rtl_unroll_and_peel_loops);
-	  NEXT_PASS (pass_rtl_doloop);
-	  NEXT_PASS (pass_rtl_loop_done);
-	  *p = NULL;
-	}
-      NEXT_PASS (pass_web);
-      NEXT_PASS (pass_jump_bypass);
-      NEXT_PASS (pass_cse2);
-      NEXT_PASS (pass_rtl_dse1);
-      NEXT_PASS (pass_rtl_fwprop_addr);
-      NEXT_PASS (pass_regclass_init);
-      NEXT_PASS (pass_inc_dec);
-      NEXT_PASS (pass_initialize_regs);
-      NEXT_PASS (pass_outof_cfg_layout_mode);
-      NEXT_PASS (pass_ud_rtl_dce);
-      NEXT_PASS (pass_combine);
-      NEXT_PASS (pass_if_after_combine);
-      NEXT_PASS (pass_partition_blocks);
-      NEXT_PASS (pass_regmove);
-      NEXT_PASS (pass_split_all_insns);
-      NEXT_PASS (pass_lower_subreg2);
-      NEXT_PASS (pass_df_initialize_no_opt);
-      NEXT_PASS (pass_stack_ptr_mod);
-      NEXT_PASS (pass_mode_switching);
-      NEXT_PASS (pass_see);
-      NEXT_PASS (pass_match_asm_constraints);
-      NEXT_PASS (pass_sms);
-      NEXT_PASS (pass_sched);
-      NEXT_PASS (pass_subregs_of_mode_init);
-      NEXT_PASS (pass_local_alloc);
-      NEXT_PASS (pass_global_alloc);
-      NEXT_PASS (pass_subregs_of_mode_finish);
-      NEXT_PASS (pass_postreload);
-	{
-	  struct tree_opt_pass **p = &pass_postreload.sub;
-	  NEXT_PASS (pass_postreload_cse);
-	  NEXT_PASS (pass_gcse2);
-	  NEXT_PASS (pass_split_after_reload);
-	  NEXT_PASS (pass_branch_target_load_optimize1);
-	  NEXT_PASS (pass_thread_prologue_and_epilogue);
-	  NEXT_PASS (pass_rtl_dse2);
-	  NEXT_PASS (pass_rtl_seqabstr);
-	  NEXT_PASS (pass_stack_adjustments);
-	  NEXT_PASS (pass_peephole2);
-	  NEXT_PASS (pass_if_after_reload);
-	  NEXT_PASS (pass_regrename);
-	  NEXT_PASS (pass_cprop_hardreg);
-	  NEXT_PASS (pass_fast_rtl_dce);
-	  NEXT_PASS (pass_reorder_blocks);
-	  NEXT_PASS (pass_branch_target_load_optimize2);
-	  NEXT_PASS (pass_leaf_regs);
-	  NEXT_PASS (pass_split_before_sched2);
-	  NEXT_PASS (pass_sched2);
-	  NEXT_PASS (pass_stack_regs);
-	    {
-	      struct tree_opt_pass **p = &pass_stack_regs.sub;
-	      NEXT_PASS (pass_split_before_regstack);
-	      NEXT_PASS (pass_stack_regs_run);
-	    }
-	  NEXT_PASS (pass_compute_alignments);
-	  NEXT_PASS (pass_duplicate_computed_gotos);
-	  NEXT_PASS (pass_variable_tracking);
-	  NEXT_PASS (pass_free_cfg);
-	  NEXT_PASS (pass_machine_reorg);
-	  NEXT_PASS (pass_cleanup_barriers);
-	  NEXT_PASS (pass_delay_slots);
-	  NEXT_PASS (pass_split_for_shorten_branches);
-	  NEXT_PASS (pass_convert_to_eh_region_ranges);
-	  NEXT_PASS (pass_shorten_branches);
-	  NEXT_PASS (pass_set_nothrow_function_flags);
-	  NEXT_PASS (pass_final);
-	}
-      NEXT_PASS (pass_df_finish);
-    }
-  NEXT_PASS (pass_clean_state);
-  *p = NULL;
-
-#undef NEXT_PASS
-
-  /* Register the passes with the tree dump code.  */
-  register_dump_files (all_lowering_passes, false, PROP_gimple_any);
-  all_lowering_passes->todo_flags_start |= TODO_set_props;
-  register_dump_files (all_ipa_passes, true,
-		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
-		       | PROP_cfg);
-  register_dump_files (all_passes, false,
-		       PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
-		       | PROP_cfg);
-}
-
 /* If we are in IPA mode (i.e., current_function_decl is NULL), call
    function CALLBACK for every function in the call graph.  Otherwise,
    call CALLBACK on the current function.  */ 
Index: working/gcc/gcc/passes.h
===================================================================
--- working/gcc/gcc/passes.h	(revision 0)
+++ working/gcc/gcc/passes.h	(revision 0)
@@ -0,0 +1,8 @@
+#ifndef GCC_PASSES_H
+#define GCC_PASSES_H 1
+
+struct tree_opt_pass **next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass);
+void register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties);
+void init_optimization_passes (void);
+
+#endif

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-11-27  0:38 Scripted pass manager Rob Quill
@ 2007-11-27 19:07 ` Richard Guenther
  2007-11-27 19:19   ` Basile STARYNKEVITCH
  2007-11-29 15:42   ` Richard Guenther
  2007-12-05  0:14 ` Diego Novillo
  1 sibling, 2 replies; 14+ messages in thread
From: Richard Guenther @ 2007-11-27 19:07 UTC (permalink / raw)
  To: Rob Quill; +Cc: gcc-patches

On Nov 26, 2007 11:20 PM, Rob Quill <rob.quill@gmail.com> wrote:
> Hi all,
>
> This patch scripts the pass manager in a way similar to the the
> options.c and options.h are generated. It shows no regressions against
> the current mainline on x86_64-linux.

;)

With a "scripted pass manager" I of course ment a pass manager that
allows re-configuration of the pass pipeline without re-compiling.  For
example by embeding LUA (or another tiny scripting language).  With
control flow you should be able to experiment with looping over
optimization passes until nothing changes, etc., much like a simple
"plugin" interface without actually having plugins.

Richard.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-11-27 19:07 ` Richard Guenther
@ 2007-11-27 19:19   ` Basile STARYNKEVITCH
  2007-11-29 15:42   ` Richard Guenther
  1 sibling, 0 replies; 14+ messages in thread
From: Basile STARYNKEVITCH @ 2007-11-27 19:19 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches, GCC Mailing List

Richard Guenther wrote:
> 
> With a "scripted pass manager" I of course ment a pass manager that
> allows re-configuration of the pass pipeline without re-compiling.  For
> example by embeding LUA (or another tiny scripting language).  

Regarding such configurability of the pass manager the GCC ICI project 
might be interesting:
http://gcc-ici.sourceforge.net/


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-11-27 19:07 ` Richard Guenther
  2007-11-27 19:19   ` Basile STARYNKEVITCH
@ 2007-11-29 15:42   ` Richard Guenther
  2007-11-29 16:40     ` Ramana Radhakrishnan
  2007-11-30 20:04     ` Rob Quill
  1 sibling, 2 replies; 14+ messages in thread
From: Richard Guenther @ 2007-11-29 15:42 UTC (permalink / raw)
  To: Rob Quill; +Cc: gcc-patches

On Nov 27, 2007 2:39 PM, Richard Guenther <richard.guenther@gmail.com> wrote:
>
> On Nov 26, 2007 11:20 PM, Rob Quill <rob.quill@gmail.com> wrote:
> > Hi all,
> >
> > This patch scripts the pass manager in a way similar to the the
> > options.c and options.h are generated. It shows no regressions against
> > the current mainline on x86_64-linux.
>
> ;)
>
> With a "scripted pass manager" I of course ment a pass manager that
> allows re-configuration of the pass pipeline without re-compiling.  For
> example by embeding LUA (or another tiny scripting language).  With
> control flow you should be able to experiment with looping over
> optimization passes until nothing changes, etc., much like a simple
> "plugin" interface without actually having plugins.

Let me elaborate a bit on what I want from a 'scripted pass manager'.
The statically specified pass pipeline is a limitation for experiments with
pass ordering - so as a first thing I'd like to dynamically initialize the
pass pipeline from - say - a textual description - that is either specified
on the command-line or by looking up a default (which would match
the current pipeline configuration) which is statically built into gcc.

<crazy ideas>
This textual description could look like your passes.def, but it could also
be a procedural elaboration of the pass flow interpreted by the GCC pass
manager.  In whatever language of choice (and with whatever interface
we can come up with).  Like:

do_passes ()
{
  if (optimize > 0)
    do_early_optimizations ()
  ...
}

do_early_optimizations ()
{
  execute_one_pass (early_inline)
  execute_one_pass (cleanup_cfg)
  ...
}

basically you would provide a scripting interface to the pass manager
backend and process the pass flow using an interpreter.
</crazy ideas>

About your patch - I would suggest to split the part that defines passes
and the pipeline description explicitly, that is, do a passes.def and a
pass-pipeline.def, where in the end we may want to move more information
to passes.def that is now spread out to the various places where we
actually define the struct tree_pass things (the TODO_s come into my mind
here).  One could even go further and try to integreate this somewhat with
common.opt where documentation and options for most of the passes are
(that is, generate a optimizers.opt from the passes.def).  But that's for
a second stage as well.

Richard.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-11-29 15:42   ` Richard Guenther
@ 2007-11-29 16:40     ` Ramana Radhakrishnan
  2007-11-30 20:04     ` Rob Quill
  1 sibling, 0 replies; 14+ messages in thread
From: Ramana Radhakrishnan @ 2007-11-29 16:40 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Rob Quill, gcc-patches

Hi,

I don't know if this totally makes sense but anyways here goes.

<continuation on crazy idea>

While we are at this . A lot of the gate functions to passes are
essentially dependent on the optimization level at which the pass is
run. I wonder if it might be worthwhile interpreting gating functions
for passes at run time.

If we are to tie this in with some of the ideas with the Function
level optimization specification bit where the user want to possibly
compile certain functions with different  optimization options and /
or passes , would we have to specify the pass dependencies so that the
pass manager would be able to automatically detect these cases and run
the dependent passes before. To run the loop unroller pass alone I
wouldn't want to ask the pass manager to have run any other pass that
this depends on.

</end continuation on crazy idea>


cheers
Ramana

On Nov 29, 2007 7:06 PM, Richard Guenther <richard.guenther@gmail.com> wrote:
>
> On Nov 27, 2007 2:39 PM, Richard Guenther <richard.guenther@gmail.com> wrote:
> >
> > On Nov 26, 2007 11:20 PM, Rob Quill <rob.quill@gmail.com> wrote:
> > > Hi all,
> > >
> > > This patch scripts the pass manager in a way similar to the the
> > > options.c and options.h are generated. It shows no regressions against
> > > the current mainline on x86_64-linux.
> >
> > ;)
> >
> > With a "scripted pass manager" I of course ment a pass manager that
> > allows re-configuration of the pass pipeline without re-compiling.  For
> > example by embeding LUA (or another tiny scripting language).  With
> > control flow you should be able to experiment with looping over
> > optimization passes until nothing changes, etc., much like a simple
> > "plugin" interface without actually having plugins.
>
> Let me elaborate a bit on what I want from a 'scripted pass manager'.
> The statically specified pass pipeline is a limitation for experiments with
> pass ordering - so as a first thing I'd like to dynamically initialize the
> pass pipeline from - say - a textual description - that is either specified
> on the command-line or by looking up a default (which would match
> the current pipeline configuration) which is statically built into gcc.
>
> <crazy ideas>
> This textual description could look like your passes.def, but it could also
> be a procedural elaboration of the pass flow interpreted by the GCC pass
> manager.  In whatever language of choice (and with whatever interface
> we can come up with).  Like:
>
> do_passes ()
> {
>   if (optimize > 0)
>     do_early_optimizations ()
>   ...
> }
>
> do_early_optimizations ()
> {
>   execute_one_pass (early_inline)
>   execute_one_pass (cleanup_cfg)
>   ...
> }
>
> basically you would provide a scripting interface to the pass manager
> backend and process the pass flow using an interpreter.
> </crazy ideas>
>
>
> Richard.
>



-- 
Ramana Radhakrishnan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-11-29 15:42   ` Richard Guenther
  2007-11-29 16:40     ` Ramana Radhakrishnan
@ 2007-11-30 20:04     ` Rob Quill
  2007-11-30 20:15       ` Richard Guenther
  1 sibling, 1 reply; 14+ messages in thread
From: Rob Quill @ 2007-11-30 20:04 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches

On 29/11/2007, Richard Guenther <richard.guenther@gmail.com> wrote:
> On Nov 27, 2007 2:39 PM, Richard Guenther <richard.guenther@gmail.com> wrote:
> >
> > On Nov 26, 2007 11:20 PM, Rob Quill <rob.quill@gmail.com> wrote:
> > > Hi all,
> > >
> > > This patch scripts the pass manager in a way similar to the the
> > > options.c and options.h are generated. It shows no regressions against
> > > the current mainline on x86_64-linux.
> >
> > ;)
> >
> > With a "scripted pass manager" I of course ment a pass manager that
> > allows re-configuration of the pass pipeline without re-compiling.  For
> > example by embeding LUA (or another tiny scripting language).  With
> > control flow you should be able to experiment with looping over
> > optimization passes until nothing changes, etc., much like a simple
> > "plugin" interface without actually having plugins.
>
> Let me elaborate a bit on what I want from a 'scripted pass manager'.
> The statically specified pass pipeline is a limitation for experiments with
> pass ordering - so as a first thing I'd like to dynamically initialize the
> pass pipeline from - say - a textual description - that is either specified
> on the command-line or by looking up a default (which would match
> the current pipeline configuration) which is statically built into gcc.

So, as a starting point it would be better if the pass order was
decided at run time by a script instead of at compile time. So, to
check we're thinking along the same lines, I'm imagining that some
function/script would read the passes.def file at run-time and build
the pass list from this, e.g. very roughly

while(not EOF)
{
     char *s = read_next_line("passes.def");
     make_next_pass(s);
}

although if it was done from the command line, I suppose we would just
have for instance, some list of passes at run-time and turn these
somehow into the actually pass list? Is that would you had in mind?

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-11-30 20:04     ` Rob Quill
@ 2007-11-30 20:15       ` Richard Guenther
  0 siblings, 0 replies; 14+ messages in thread
From: Richard Guenther @ 2007-11-30 20:15 UTC (permalink / raw)
  To: Rob Quill; +Cc: gcc-patches

On Nov 30, 2007 3:02 PM, Rob Quill <rob.quill@gmail.com> wrote:
> On 29/11/2007, Richard Guenther <richard.guenther@gmail.com> wrote:
> > On Nov 27, 2007 2:39 PM, Richard Guenther <richard.guenther@gmail.com> wrote:
> > >
> > > On Nov 26, 2007 11:20 PM, Rob Quill <rob.quill@gmail.com> wrote:
> > > > Hi all,
> > > >
> > > > This patch scripts the pass manager in a way similar to the the
> > > > options.c and options.h are generated. It shows no regressions against
> > > > the current mainline on x86_64-linux.
> > >
> > > ;)
> > >
> > > With a "scripted pass manager" I of course ment a pass manager that
> > > allows re-configuration of the pass pipeline without re-compiling.  For
> > > example by embeding LUA (or another tiny scripting language).  With
> > > control flow you should be able to experiment with looping over
> > > optimization passes until nothing changes, etc., much like a simple
> > > "plugin" interface without actually having plugins.
> >
> > Let me elaborate a bit on what I want from a 'scripted pass manager'.
> > The statically specified pass pipeline is a limitation for experiments with
> > pass ordering - so as a first thing I'd like to dynamically initialize the
> > pass pipeline from - say - a textual description - that is either specified
> > on the command-line or by looking up a default (which would match
> > the current pipeline configuration) which is statically built into gcc.
>
> So, as a starting point it would be better if the pass order was
> decided at run time by a script instead of at compile time. So, to
> check we're thinking along the same lines, I'm imagining that some
> function/script would read the passes.def file at run-time and build
> the pass list from this, e.g. very roughly
>
> while(not EOF)
> {
>      char *s = read_next_line("passes.def");
>      make_next_pass(s);
> }
>
> although if it was done from the command line, I suppose we would just
> have for instance, some list of passes at run-time and turn these
> somehow into the actually pass list? Is that would you had in mind?

Yes, that would already be very useful.  You'd either specify
-fpasses=/tmp/my_passes.def or a default passes.def would be used
(either
installed somewhere or preferably statically built into the compiler).

Richard.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-11-27  0:38 Scripted pass manager Rob Quill
  2007-11-27 19:07 ` Richard Guenther
@ 2007-12-05  0:14 ` Diego Novillo
  2007-12-05  0:56   ` Andrew Pinski
  2007-12-05 15:36   ` Ian Lance Taylor
  1 sibling, 2 replies; 14+ messages in thread
From: Diego Novillo @ 2007-12-05  0:14 UTC (permalink / raw)
  To: Rob Quill; +Cc: gcc-patches, Ben Elliston

Rob Quill wrote:

> This patch scripts the pass manager in a way similar to the the
> options.c and options.h are generated. It shows no regressions against
> the current mainline on x86_64-linux.

Interesting, you may want to contact Ben Elliston who worked on a 
dynamic pass manager implementation that was able to re-order passes on 
the fly without having to recompile GCC.  His master's thesis should 
have more details about it.

We've discussed the idea of a dynamic pass manager many times in the 
past.  It's been very high on my wish lists for a few years now, but of 
course I haven't done anything other than "talk" about it.

A scripted pass manager is a step forward, but I think we can go to a 
fully dynamic manager.  The features I've been looking for:

- Various pass schedules are fixed and associated with the different -Ox 
flags.

- A specific schedule can be altered using a combination of -f options 
or perhaps an external description file.  This may make bug reproduction 
a bit harder, so we may want to limit how much freedom we give users here.


Diego.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-12-05  0:14 ` Diego Novillo
@ 2007-12-05  0:56   ` Andrew Pinski
  2007-12-05 15:36   ` Ian Lance Taylor
  1 sibling, 0 replies; 14+ messages in thread
From: Andrew Pinski @ 2007-12-05  0:56 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Rob Quill, gcc-patches, Ben Elliston

On 12/4/07, Diego Novillo <dnovillo@google.com> wrote:
> - A specific schedule can be altered using a combination of -f options
> or perhaps an external description file.  This may make bug reproduction
> a bit harder, so we may want to limit how much freedom we give users here.

For bug reproduction, we could output the full script that would be
able to repdoduce it, just like we do for the gc parmaters and like ld
does for the linker script.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-12-05  0:14 ` Diego Novillo
  2007-12-05  0:56   ` Andrew Pinski
@ 2007-12-05 15:36   ` Ian Lance Taylor
  2007-12-05 18:38     ` Rob Quill
       [not found]     ` <20071205222948.GC24660@air.net.au>
  1 sibling, 2 replies; 14+ messages in thread
From: Ian Lance Taylor @ 2007-12-05 15:36 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Rob Quill, gcc-patches, Ben Elliston

Diego Novillo <dnovillo@google.com> writes:

> A scripted pass manager is a step forward, but I think we can go to a
> fully dynamic manager.  The features I've been looking for:
> 
> - Various pass schedules are fixed and associated with the different
> -Ox flags.
> 
> - A specific schedule can be altered using a combination of -f options
> or perhaps an external description file.  This may make bug
> reproduction a bit harder, so we may want to limit how much freedom we
> give users here.

I would like the ability for backends to insert specific passes at
specific points.

For example, we would use that ability to move bt-load.c into
config/sh, instead of building it for every target.

Ian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-12-05 15:36   ` Ian Lance Taylor
@ 2007-12-05 18:38     ` Rob Quill
  2007-12-05 18:41       ` Richard Guenther
  2007-12-05 18:42       ` Diego Novillo
       [not found]     ` <20071205222948.GC24660@air.net.au>
  1 sibling, 2 replies; 14+ messages in thread
From: Rob Quill @ 2007-12-05 18:38 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Diego Novillo, gcc-patches, Ben Elliston

On 05 Dec 2007 07:35:35 -0800, Ian Lance Taylor <iant@google.com> wrote:
> Diego Novillo <dnovillo@google.com> writes:
>
> > A scripted pass manager is a step forward, but I think we can go to a
> > fully dynamic manager.

OK, so do you think it is best to try and start making a scripted pass
manager, or jump straight into making a dynamic one?

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-12-05 18:38     ` Rob Quill
@ 2007-12-05 18:41       ` Richard Guenther
  2007-12-05 18:42       ` Diego Novillo
  1 sibling, 0 replies; 14+ messages in thread
From: Richard Guenther @ 2007-12-05 18:41 UTC (permalink / raw)
  To: Rob Quill; +Cc: Ian Lance Taylor, Diego Novillo, gcc-patches, Ben Elliston

On Dec 5, 2007 7:38 PM, Rob Quill <rob.quill@gmail.com> wrote:
> On 05 Dec 2007 07:35:35 -0800, Ian Lance Taylor <iant@google.com> wrote:
> > Diego Novillo <dnovillo@google.com> writes:
> >
> > > A scripted pass manager is a step forward, but I think we can go to a
> > > fully dynamic manager.
>
> OK, so do you think it is best to try and start making a scripted pass
> manager, or jump straight into making a dynamic one?

The difference from what we have now should be similar, so I'd jump
straight to the dynamic one.  Whatever the exact difference between
a scripted (as in my sense - Diego replied to your original mail) and a
dynamic one is ;)

Richard.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
  2007-12-05 18:38     ` Rob Quill
  2007-12-05 18:41       ` Richard Guenther
@ 2007-12-05 18:42       ` Diego Novillo
  1 sibling, 0 replies; 14+ messages in thread
From: Diego Novillo @ 2007-12-05 18:42 UTC (permalink / raw)
  To: Rob Quill; +Cc: Ian Lance Taylor, gcc-patches, Ben Elliston

On 12/5/07 1:38 PM, Rob Quill wrote:
> On 05 Dec 2007 07:35:35 -0800, Ian Lance Taylor <iant@google.com> wrote:
>> Diego Novillo <dnovillo@google.com> writes:
>>
>>> A scripted pass manager is a step forward, but I think we can go to a
>>> fully dynamic manager.
> 
> OK, so do you think it is best to try and start making a scripted pass
> manager, or jump straight into making a dynamic one?

I vote for going to a full dynamic pass manager.  Perhaps start with a 
message giving an overview of what you have in mind, so that we can 
refine what features we want.

Thanks for tackling this, btw.  It's been on my wish list for a long time.


Diego.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Scripted pass manager
       [not found]     ` <20071205222948.GC24660@air.net.au>
@ 2007-12-06 10:46       ` Rob Quill
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Quill @ 2007-12-06 10:46 UTC (permalink / raw)
  To: Ben Elliston; +Cc: Ian Lance Taylor, Diego Novillo, gcc-patches

On 05/12/2007, Ben Elliston <bje@air.net.au> wrote:
> > I would like the ability for backends to insert specific passes at
> > specific points.
>
> I think it would also be valuable if individual optimisers could alter
> the pass sequence, too, based on information they uncover as they do
> their work.

OK, I will have a popper look at how to go about implementing this and
write an email with my thoughts early next week. For now though, I
have to put some time into thinking about my own Masters thesis
(thanks for the link to yours Ben).

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-12-06 10:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-27  0:38 Scripted pass manager Rob Quill
2007-11-27 19:07 ` Richard Guenther
2007-11-27 19:19   ` Basile STARYNKEVITCH
2007-11-29 15:42   ` Richard Guenther
2007-11-29 16:40     ` Ramana Radhakrishnan
2007-11-30 20:04     ` Rob Quill
2007-11-30 20:15       ` Richard Guenther
2007-12-05  0:14 ` Diego Novillo
2007-12-05  0:56   ` Andrew Pinski
2007-12-05 15:36   ` Ian Lance Taylor
2007-12-05 18:38     ` Rob Quill
2007-12-05 18:41       ` Richard Guenther
2007-12-05 18:42       ` Diego Novillo
     [not found]     ` <20071205222948.GC24660@air.net.au>
2007-12-06 10:46       ` Rob Quill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).