This is a follow up to the patch set starting at https://gcc.gnu.org/pipermail/gcc-patches/2014-April/386650.html.
Currently TODO_verify_{il,all} is set by a few passes as TODOs afterwards but
we don't need to do that any more. Those were mostly removed back in
https://gcc.gnu.org/pipermail/gcc-patches/2014-May/387647.html
And now since TODO_verify_all is no longer used, remove it too.
Removes last_verified from the function structure since it is always 0 before the
call to execute_todo that has TODO_verify_all set on it.
Also this removes the ability for good to use TODO_verify_il from the passes and reserves
bit 31 of the TODO for the verfification and internally only the passes.cc code.
gcc/ChangeLog:
* function.h (struct function): Remove last_verified.
* gimple-harden-conditionals.cc (pass_data_harden_compares): Remove
TODO_verify_il.
(pass_data_harden_conditional_branches): Likewise.
* gimple-harden-control-flow.cc (pass_harden_control_flow_redundancy::execute):
Don't return TODO_verify_il.
* ipa-strub.cc (pass_data_ipa_strub): Remove TODO_verify_il.
* passes.cc (TODO_verify_il): Define.
(execute_function_todo): Don't use or set last_verified.
(clear_last_verified): Remove.
(execute_one_ipa_transform_pass): Update comment before execute_todo.
Assert that none of the todos have TODO_verify_il set on it.
(execute_one_pass): Don't call clear_last_verified on all functions.
Assert that none of the todos have TODO_verify_il set on it.
* tree-inline.cc (initialize_cfun): Don't copy last_verified.
* tree-pass.h (TODO_verify_all): Remove.
* tree-vrp.cc (pass_data_early_vrp): Remove TODO_verify_all.
(pass_data_fast_vrp): Likewise.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
/* Properties used by the pass manager. */
unsigned int curr_properties;
- unsigned int last_verified;
/* Different from normal TODO_flags which are handled right at the
beginning or the end of one pass execution, the pending_TODOs
0, // properties_destroyed
0, // properties_start
TODO_update_ssa
- | TODO_cleanup_cfg
- | TODO_verify_il, // properties_finish
+ | TODO_cleanup_cfg, // properties_finish
};
class pass_harden_compares : public gimple_opt_pass
0, // properties_destroyed
0, // properties_start
TODO_update_ssa
- | TODO_cleanup_cfg
- | TODO_verify_il, // properties_finish
+ | TODO_cleanup_cfg, // properties_finish
};
class pass_harden_conditional_branches : public gimple_opt_pass
return
TODO_update_ssa
- | TODO_cleanup_cfg
- | TODO_verify_il;
+ | TODO_cleanup_cfg;
}
/* Instantiate a hardcfr pass. */
0, // properties_start
TODO_update_ssa
| TODO_cleanup_cfg
- | TODO_rebuild_cgraph_edges
- | TODO_verify_il, // properties_finish
+ | TODO_rebuild_cgraph_edges, // properties_finish
};
class pass_ipa_strub : public simple_ipa_opt_pass
#include "stringpool.h"
#include "attribs.h"
+/* Reserved TODOs */
+#define TODO_verify_il (1u << 31)
+
using namespace gcc;
/* This is used for debugging. It allows the current pass to printed
{
bool from_ipa_pass = (cfun == NULL);
unsigned int flags = (size_t)data;
- flags &= ~fn->last_verified;
if (!flags)
return;
gcc_assert (dom_info_state (fn, CDI_POST_DOMINATORS) == pre_verify_pstate);
}
- fn->last_verified = flags & TODO_verify_all;
-
pop_cfun ();
/* For IPA passes make sure to release dominator info, it can be
gcc_checking_assert (!fold_deferring_overflow_warnings_p ());
}
-/* Clear the last verified flag. */
-
-static void
-clear_last_verified (function *fn, void *data ATTRIBUTE_UNUSED)
-{
- fn->last_verified = 0;
-}
-
/* Helper function. Verify that the properties has been turn into the
properties expected by the pass. */
if (pass->tv_id != TV_NONE)
timevar_push (pass->tv_id);
+ gcc_checking_assert (!(ipa_pass->function_transform_todo_flags_start & TODO_verify_il));
/* Run pre-pass verification. */
execute_todo (ipa_pass->function_transform_todo_flags_start);
/* Do it! */
todo_after = ipa_pass->function_transform (node);
- /* Run post-pass cleanup and verification. */
+ /* Run post-pass cleanup. */
+ gcc_checking_assert (!(todo_after & TODO_verify_il));
execute_todo (todo_after);
verify_interpass_invariants ();
/* Run pre-pass verification. */
+ gcc_checking_assert (!(pass->todo_flags_start & TODO_verify_il));
execute_todo (pass->todo_flags_start);
if (flag_checking)
return true;
}
- do_per_function (clear_last_verified, NULL);
-
do_per_function (update_properties_after_pass, pass);
/* Run post-pass cleanup and verification. */
+ gcc_checking_assert (!(todo_after & TODO_verify_il));
+ gcc_checking_assert (!(pass->todo_flags_finish & TODO_verify_il));
execute_todo (todo_after | pass->todo_flags_finish | TODO_verify_il);
if (profile_report)
{
cfun->nonlocal_goto_save_area = src_cfun->nonlocal_goto_save_area;
cfun->function_end_locus = src_cfun->function_end_locus;
cfun->curr_properties = src_cfun->curr_properties;
- cfun->last_verified = src_cfun->last_verified;
cfun->va_list_gpr_size = src_cfun->va_list_gpr_size;
cfun->va_list_fpr_size = src_cfun->va_list_fpr_size;
cfun->has_nonlocal_label = src_cfun->has_nonlocal_label;
(PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)
/* To-do flags. */
+/* Note (1ul << 31) is reserved for TODO_verify_il. */
#define TODO_do_not_ggc_collect (1 << 1)
#define TODO_cleanup_cfg (1 << 5)
-#define TODO_verify_il (1 << 6)
#define TODO_dump_symtab (1 << 7)
#define TODO_remove_functions (1 << 8)
and stop pass manager. */
#define TODO_discard_function (1 << 23)
+/* (1ul << 31) is reserved for TODO_verify_il. */
+
/* Internally used in execute_function_todo(). */
#define TODO_update_ssa_any \
(TODO_update_ssa \
| TODO_update_ssa_full_phi \
| TODO_update_ssa_only_virtuals)
-#define TODO_verify_all TODO_verify_il
-
/* To-do flags for pending_TODOs. */
/* Tell the next scalar cleanup pass that there is
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- ( TODO_cleanup_cfg | TODO_update_ssa | TODO_verify_all ),
+ ( TODO_cleanup_cfg | TODO_update_ssa ),
};
const pass_data pass_data_fast_vrp =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- ( TODO_cleanup_cfg | TODO_update_ssa | TODO_verify_all ),
+ ( TODO_cleanup_cfg | TODO_update_ssa ),
};