diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2020-06-10 14:37:49 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2020-06-10 14:44:48 +0200 |
commit | e09c42b8a4ce917dc3a2d89b76a9bd25b4d55eb3 (patch) | |
tree | 6e2392f0df7ffda96f3b27bec7ea06f96c235194 /gcc | |
parent | 52e2fc662a73b7b463709be2caaec1bf6454a747 (diff) | |
download | gcc-e09c42b8a4ce917dc3a2d89b76a9bd25b4d55eb3.zip gcc-e09c42b8a4ce917dc3a2d89b76a9bd25b4d55eb3.tar.gz gcc-e09c42b8a4ce917dc3a2d89b76a9bd25b4d55eb3.tar.bz2 |
Revamp frvrp*changes flags.
Flags are now:
frvrp1-changes
Common Var(flag_rvrp1_changes) Init(0)
Allow IL changes in rvrp1 pass.
frvrp2-changes
Common Var(flag_rvrp2_changes) Init(1)
Allow IL changes in rvrp2 pass.
fevrp-traps
Common Var(flag_evrp_traps) Init(0)
Trap on any EVRP changes to the IL.
There is also another flag, but it is for testsuite use only, to turn
on/off the RVRP changes for all passes:
frvrp-changes
Common Var(flag_rvrp_changes) Init(-1)
Override for both -frvrp1-changes and -frvrp2-changes. This is meant
to be used by the testsuite to keep RVRP passes from making IL changes
in some tests, thus making easier to test evrp functionality.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/common.opt | 22 | ||||
-rw-r--r-- | gcc/gimple-ranger-vrp.cc | 10 | ||||
-rw-r--r-- | gcc/misc.cc | 2 | ||||
-rw-r--r-- | gcc/misc.h | 6 | ||||
-rw-r--r-- | gcc/opts.c | 2 | ||||
-rw-r--r-- | gcc/passes.def | 4 | ||||
-rw-r--r-- | gcc/vr-values.c | 2 |
7 files changed, 21 insertions, 27 deletions
diff --git a/gcc/common.opt b/gcc/common.opt index 5404145..7e9d2a4 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2922,17 +2922,23 @@ fvect-cost-model Common Alias(fvect-cost-model=,dynamic,unlimited) Enables the dynamic vectorizer cost model. Preserved for backward compatibility. -frvrp-changes -Common Var(flag_rvrp_changes) Init(-1) -Allow RVRP passes to make IL changes. - -;; Allow IL changes in rvrp1 pass. frvrp1-changes -Common Var(flag_rvrp1_changes) Init(-1) +Common Var(flag_rvrp1_changes) Init(0) +Allow IL changes in rvrp1 pass. -;; Allow IL changes in rvrp2 pass. frvrp2-changes -Common Var(flag_rvrp2_changes) Init(-1) +Common Var(flag_rvrp2_changes) Init(1) +Allow IL changes in rvrp2 pass. + +fevrp-traps +Common Var(flag_evrp_traps) Init(0) +Trap on any EVRP changes to the IL. + +frvrp-changes +Common Var(flag_rvrp_changes) Init(-1) +Override for both -frvrp1-changes and -frvrp2-changes. This is meant +to be used by the testsuite to keep RVRP passes from making IL changes +in some tests, thus making easier to test evrp functionality. ftree-vect-loop-version Common Ignore diff --git a/gcc/gimple-ranger-vrp.cc b/gcc/gimple-ranger-vrp.cc index dd8a1ac..02bb1a3 100644 --- a/gcc/gimple-ranger-vrp.cc +++ b/gcc/gimple-ranger-vrp.cc @@ -161,20 +161,14 @@ public: pass++; } opt_pass *clone () { return new pass_ranger_vrp (m_ctxt); } - void set_pass_param (unsigned int n ATTRIBUTE_UNUSED, bool param) - { - allow_il_changes = param; - } virtual bool gate (function *) { return flag_tree_vrp != 0; } virtual unsigned int execute (function *) { - // -frvrp[12]-changes overrides pass defaults. - if (rvrp_pass_num == 1 && flag_rvrp1_changes != -1) + if (rvrp_pass_num == 1) allow_il_changes = flag_rvrp1_changes; - if (rvrp_pass_num == 2 && flag_rvrp2_changes != -1) + if (rvrp_pass_num == 2) allow_il_changes = flag_rvrp2_changes; - return execute_ranger_vrp (allow_il_changes); } private: diff --git a/gcc/misc.cc b/gcc/misc.cc index e65e034..8a4e358 100644 --- a/gcc/misc.cc +++ b/gcc/misc.cc @@ -160,7 +160,7 @@ gimple_state::set_orig_stmt (gimple *stmt) void gimple_state::maybe_dump_differences_and_trap (gimple *new_stmt, tree lhs) { - if (evrp_trap_p ()) + if (flag_evrp_traps) { if (unseen_function_p ()) { @@ -66,9 +66,3 @@ private: const irange *m_new_range; class vr_values *m_vr_values; }; - -static inline bool -evrp_trap_p () -{ - return flag_rvrp1_changes > 0; -} @@ -973,7 +973,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, opts->x_flag_reorder_blocks = 1; } - // -frvrp-changes overrides the individual pass settings. + // -frvrp-changes overrides the individual -frvrp[12]-changes. if (opts->x_flag_rvrp_changes != -1) { opts->x_flag_rvrp1_changes = opts->x_flag_rvrp_changes; diff --git a/gcc/passes.def b/gcc/passes.def index 9cbd9cf..edf579a 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -85,13 +85,13 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_build_ealias); NEXT_PASS (pass_fre, true /* may_iterate */); - NEXT_PASS (pass_ranger_vrp, false /* allow_il_changes */); + NEXT_PASS (pass_ranger_vrp); /* Run copy-prop to keep evrp below from doing simple copy prop and messing up our comparison and trap phase. */ NEXT_PASS (pass_evrp_copy_prop); NEXT_PASS (pass_early_vrp); - NEXT_PASS (pass_ranger_vrp, true /* allow_il_changes */); + NEXT_PASS (pass_ranger_vrp); NEXT_PASS (pass_merge_phi); NEXT_PASS (pass_dse); NEXT_PASS (pass_cd_dce); diff --git a/gcc/vr-values.c b/gcc/vr-values.c index 5f9e64e..0a8f14a 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -4011,7 +4011,7 @@ simplify_conversion_using_ranges (gimple_stmt_iterator *gsi, gimple *stmt) // FIXME: This conversion has nothing to do with ranges, and the way // it uses global ranges versus local ranges is interfering with our // ability to diagnose differences between evrp and rvrp1. - if (evrp_trap_p ()) + if (flag_evrp_traps) return false; /* Get the value-range of the inner operand. Use get_range_info in |