diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-09 15:57:43 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-09 15:57:43 +0000 |
commit | eacbf1cd3aff3dbf47a71dc7fdb1d01dce8e777e (patch) | |
tree | 1bfb594134ffebca206d3ed2fe55693634759c1d /gcc/cse.c | |
parent | 11fd42e7594bdb9c8d9cf10f9924cb8644752b78 (diff) | |
download | gcc-eacbf1cd3aff3dbf47a71dc7fdb1d01dce8e777e.tar.gz |
2013-09-09 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 202389 using svnmerge.py; notice
that gcc/melt/xtramelt-ana-base.melt has been significantly
updated, but some updates are yet missing...
[gcc/]
2013-09-09 Basile Starynkevitch <basile@starynkevitch.net>
{{When merging trunk GCC 4.9 with C++ passes}}
* melt/xtramelt-ana-base.melt: Add GCC 4.9 specific code, still
incomplete, for classy passes.... Only Gimple passes are yet possible...
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@202408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 166 |
1 files changed, 111 insertions, 55 deletions
diff --git a/gcc/cse.c b/gcc/cse.c index 31a1cd03f66..b96af19f9e4 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -5381,7 +5381,7 @@ cse_insn (rtx insn) && CONST_INT_P (width) && INTVAL (width) < HOST_BITS_PER_WIDE_INT && ! (INTVAL (src_const) - & ((HOST_WIDE_INT) (-1) << INTVAL (width)))) + & (HOST_WIDE_INT_M1U << INTVAL (width)))) /* Exception: if the value is constant, and it won't be truncated, record it. */ ; @@ -7449,27 +7449,45 @@ rest_of_handle_cse (void) return 0; } -struct rtl_opt_pass pass_cse = +namespace { + +const pass_data pass_data_cse = { - { - RTL_PASS, - "cse1", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_handle_cse, /* gate */ - rest_of_handle_cse, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_CSE, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_df_finish | TODO_verify_rtl_sharing | - TODO_verify_flow /* todo_flags_finish */ - } + RTL_PASS, /* type */ + "cse1", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_CSE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + ( TODO_df_finish | TODO_verify_rtl_sharing + | TODO_verify_flow ), /* todo_flags_finish */ }; +class pass_cse : public rtl_opt_pass +{ +public: + pass_cse(gcc::context *ctxt) + : rtl_opt_pass(pass_data_cse, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_handle_cse (); } + unsigned int execute () { return rest_of_handle_cse (); } + +}; // class pass_cse + +} // anon namespace + +rtl_opt_pass * +make_pass_cse (gcc::context *ctxt) +{ + return new pass_cse (ctxt); +} + static bool gate_handle_cse2 (void) @@ -7511,27 +7529,45 @@ rest_of_handle_cse2 (void) } -struct rtl_opt_pass pass_cse2 = +namespace { + +const pass_data pass_data_cse2 = { - { - RTL_PASS, - "cse2", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_handle_cse2, /* gate */ - rest_of_handle_cse2, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_CSE2, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_df_finish | TODO_verify_rtl_sharing | - TODO_verify_flow /* todo_flags_finish */ - } + RTL_PASS, /* type */ + "cse2", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_CSE2, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + ( TODO_df_finish | TODO_verify_rtl_sharing + | TODO_verify_flow ), /* todo_flags_finish */ }; +class pass_cse2 : public rtl_opt_pass +{ +public: + pass_cse2(gcc::context *ctxt) + : rtl_opt_pass(pass_data_cse2, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_handle_cse2 (); } + unsigned int execute () { return rest_of_handle_cse2 (); } + +}; // class pass_cse2 + +} // anon namespace + +rtl_opt_pass * +make_pass_cse2 (gcc::context *ctxt) +{ + return new pass_cse2 (ctxt); +} + static bool gate_handle_cse_after_global_opts (void) { @@ -7571,23 +7607,43 @@ rest_of_handle_cse_after_global_opts (void) return 0; } -struct rtl_opt_pass pass_cse_after_global_opts = +namespace { + +const pass_data pass_data_cse_after_global_opts = { - { - RTL_PASS, - "cse_local", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_handle_cse_after_global_opts, /* gate */ - rest_of_handle_cse_after_global_opts, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_CSE, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_df_finish | TODO_verify_rtl_sharing | - TODO_verify_flow /* todo_flags_finish */ - } + RTL_PASS, /* type */ + "cse_local", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_CSE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + ( TODO_df_finish | TODO_verify_rtl_sharing + | TODO_verify_flow ), /* todo_flags_finish */ }; + +class pass_cse_after_global_opts : public rtl_opt_pass +{ +public: + pass_cse_after_global_opts(gcc::context *ctxt) + : rtl_opt_pass(pass_data_cse_after_global_opts, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_handle_cse_after_global_opts (); } + unsigned int execute () { + return rest_of_handle_cse_after_global_opts (); + } + +}; // class pass_cse_after_global_opts + +} // anon namespace + +rtl_opt_pass * +make_pass_cse_after_global_opts (gcc::context *ctxt) +{ + return new pass_cse_after_global_opts (ctxt); +} |