- Add add-checks-to-avoid-spoiling-if-conversion.patch - Add add-option-fallow-store-data-races.patch - Add complete-struct-reorg.patch - Add cse-in-vectorization.patch - Add enable-simd-math.patch - Add fix-ICE-avoid-issueing-loads-in-SM-when-possible.patch - Add fix-ICE-in-compute_live_loop_exits.patch - Add fix-ICE-in-copy_reference_ops_from_ref.patch - Add fix-ICE-in-declare-return-variable.patch - Add fix-ICE-in-exact_div.patch - Add fix-ICE-in-gimple_op.patch - Add fix-ICE-in-model_update_limit_points_in_group.patch - Add fix-ICE-in-reload.patch - Add fix-ICE-in-store_constructor.patch - Add fix-ICE-in-vec.patch - Add fix-ICE-in-vect_create_epilog_for_reduction.patch - Add fix-ICE-in-vect_create_epilog_for_reduction_2.patch - Add fix-ICE-in-vect_create_epilog_for_reduction_3.patch - Add fix-ICE-in-vect_get_vec_def_for_stmt_copy.patch - Add fix-ICE-in-vect_slp_analyze_node_operations.patch - Add fix-ICE-in-vect_stmt_to_vectorize.patch - Add fix-ICE-in-vect_transform_stmt.patch - Add fix-ICE-in-vectorizable_condition.patch - Add fix-ICE-in-verify_ssa.patch - Add fix-ICE-statement-uses-released-SSA-name.patch - Add fix-ICE-when-vectorizing-nested-cycles.patch - Add fix-SSA-update-for-vectorizer-epilogue.patch - Add fix-do-not-build-op.patch - Add fix-load-eliding-in-SM.patch - Add fix-wrong-vectorizer-code.patch - Add generate-csel-for-arrayref.patch - Add ipa-const-prop-self-recursion-bugfix.patch - Add ipa-const-prop.patch - Add ipa-struct-reorg-bugfix.patch - Add ipa-struct-reorg.patch - Add medium-code-mode.patch - Add reduction-chain-slp-option.patch - Add reductions-slp-enhancement.patch - Add simplify-removing-subregs.patch - Add tighten-range-for-generating-csel.patch - Add vectorization-enhancement.patch - Add add-checks-to-avoid-spoiling-if-conversion.patch - Add add-option-fallow-store-data-races.patch - Add complete-struct-reorg.patch - Add cse-in-vectorization.patch - Add enable-simd-math.patch - Add fix-ICE-avoid-issueing-loads-in-SM-when-possible.patch - Add fix-ICE-in-compute_live_loop_exits.patch - Add fix-ICE-in-copy_reference_ops_from_ref.patch - Add fix-ICE-in-declare-return-variable.patch - Add fix-ICE-in-exact_div.patch - Add fix-ICE-in-gimple_op.patch - Add fix-ICE-in-model_update_limit_points_in_group.patch - Add fix-ICE-in-reload.patch - Add fix-ICE-in-store_constructor.patch - Add fix-ICE-in-vec.patch - Add fix-ICE-in-vect_create_epilog_for_reduction.patch - Add fix-ICE-in-vect_create_epilog_for_reduction_2.patch - Add fix-ICE-in-vect_create_epilog_for_reduction_3.patch - Add fix-ICE-in-vect_get_vec_def_for_stmt_copy.patch - Add fix-ICE-in-vect_slp_analyze_node_operations.patch - Add fix-ICE-in-vect_stmt_to_vectorize.patch - Add fix-ICE-in-vect_transform_stmt.patch - Add fix-ICE-in-vectorizable_condition.patch - Add fix-ICE-in-verify_ssa.patch - Add fix-ICE-statement-uses-released-SSA-name.patch - Add fix-ICE-when-vectorizing-nested-cycles.patch - Add fix-SSA-update-for-vectorizer-epilogue.patch - Add fix-do-not-build-op.patch - Add fix-load-eliding-in-SM.patch - Add fix-wrong-vectorizer-code.patch - Add generate-csel-for-arrayref.patch - Add ipa-const-prop-self-recursion-bugfix.patch - Add ipa-const-prop.patch - Add ipa-struct-reorg-bugfix.patch - Add ipa-struct-reorg.patch - Add medium-code-mode.patch - Add reduction-chain-slp-option.patch - Add reductions-slp-enhancement.patch - Add simplify-removing-subregs.patch - Add tighten-range-for-generating-csel.patch - Add vectorization-enhancement.patch
110 lines
4.6 KiB
Diff
110 lines
4.6 KiB
Diff
This backport contains 1 patch from gcc main stream tree.
|
|
The commit id of these patchs list as following in the order of time.
|
|
|
|
0001-tree-ssa-sccvn.c-class-pass_fre-Add-may_iterate-pass.patch
|
|
744fd446c321f78f9a1ce4ef5f83df8dcfa44a9e
|
|
|
|
diff -Nurp a/gcc/passes.def b/gcc/passes.def
|
|
--- a/gcc/passes.def 2020-08-17 09:46:40.340000000 +0800
|
|
+++ b/gcc/passes.def 2020-08-17 10:09:10.808000000 +0800
|
|
@@ -83,7 +83,7 @@ along with GCC; see the file COPYING3.
|
|
/* pass_build_ealias is a dummy pass that ensures that we
|
|
execute TODO_rebuild_alias at this point. */
|
|
NEXT_PASS (pass_build_ealias);
|
|
- NEXT_PASS (pass_fre);
|
|
+ NEXT_PASS (pass_fre, true /* may_iterate */);
|
|
NEXT_PASS (pass_early_vrp);
|
|
NEXT_PASS (pass_merge_phi);
|
|
NEXT_PASS (pass_dse);
|
|
@@ -117,7 +117,7 @@ along with GCC; see the file COPYING3.
|
|
NEXT_PASS (pass_oacc_kernels);
|
|
PUSH_INSERT_PASSES_WITHIN (pass_oacc_kernels)
|
|
NEXT_PASS (pass_ch);
|
|
- NEXT_PASS (pass_fre);
|
|
+ NEXT_PASS (pass_fre, true /* may_iterate */);
|
|
/* We use pass_lim to rewrite in-memory iteration and reduction
|
|
variable accesses in loops into local variables accesses. */
|
|
NEXT_PASS (pass_lim);
|
|
@@ -201,7 +201,7 @@ along with GCC; see the file COPYING3.
|
|
execute TODO_rebuild_alias at this point. */
|
|
NEXT_PASS (pass_build_alias);
|
|
NEXT_PASS (pass_return_slot);
|
|
- NEXT_PASS (pass_fre);
|
|
+ NEXT_PASS (pass_fre, true /* may_iterate */);
|
|
NEXT_PASS (pass_merge_phi);
|
|
NEXT_PASS (pass_thread_jumps);
|
|
NEXT_PASS (pass_vrp, true /* warn_array_bounds_p */);
|
|
@@ -312,6 +312,7 @@ along with GCC; see the file COPYING3.
|
|
NEXT_PASS (pass_strength_reduction);
|
|
NEXT_PASS (pass_split_paths);
|
|
NEXT_PASS (pass_tracer);
|
|
+ NEXT_PASS (pass_fre, false /* may_iterate */);
|
|
NEXT_PASS (pass_thread_jumps);
|
|
NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */);
|
|
NEXT_PASS (pass_strlen);
|
|
diff -Nurp a/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c
|
|
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c 2020-08-17 09:46:41.332000000 +0800
|
|
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c 2020-08-17 10:09:10.808000000 +0800
|
|
@@ -125,7 +125,7 @@ enum STATES FMS( u8 **in , u32 *transiti
|
|
jump threading opportunities. Skip the later tests on aarch64. */
|
|
/* { dg-final { scan-tree-dump "Jumps threaded: 1\[1-9\]" "thread1" } } */
|
|
/* { dg-final { scan-tree-dump-times "Invalid sum" 3 "thread1" } } */
|
|
-/* { dg-final { scan-tree-dump-not "not considered" "thread1" } } */
|
|
-/* { dg-final { scan-tree-dump-not "not considered" "thread2" } } */
|
|
-/* { dg-final { scan-tree-dump-not "not considered" "thread3" { target { ! aarch64*-*-* } } } } */
|
|
-/* { dg-final { scan-tree-dump-not "not considered" "thread4" { target { ! aarch64*-*-* } } } } */
|
|
+/* { dg-final { scan-tree-dump-not "optimizing for size" "thread1" } } */
|
|
+/* { dg-final { scan-tree-dump-not "optimizing for size" "thread2" } } */
|
|
+/* { dg-final { scan-tree-dump-not "optimizing for size" "thread3" { target { ! aarch64*-*-* } } } } */
|
|
+/* { dg-final { scan-tree-dump-not "optimizing for size" "thread4" { target { ! aarch64*-*-* } } } } */
|
|
diff -Nurp a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
|
|
--- a/gcc/tree-ssa-sccvn.c 2020-08-17 09:46:42.212000000 +0800
|
|
+++ b/gcc/tree-ssa-sccvn.c 2020-08-17 10:09:10.808000000 +0800
|
|
@@ -7232,14 +7232,24 @@ class pass_fre : public gimple_opt_pass
|
|
{
|
|
public:
|
|
pass_fre (gcc::context *ctxt)
|
|
- : gimple_opt_pass (pass_data_fre, ctxt)
|
|
+ : gimple_opt_pass (pass_data_fre, ctxt), may_iterate (true)
|
|
{}
|
|
|
|
/* opt_pass methods: */
|
|
opt_pass * clone () { return new pass_fre (m_ctxt); }
|
|
- virtual bool gate (function *) { return flag_tree_fre != 0; }
|
|
+ void set_pass_param (unsigned int n, bool param)
|
|
+ {
|
|
+ gcc_assert (n == 0);
|
|
+ may_iterate = param;
|
|
+ }
|
|
+ virtual bool gate (function *)
|
|
+ {
|
|
+ return flag_tree_fre != 0 && (may_iterate || optimize > 1);
|
|
+ }
|
|
virtual unsigned int execute (function *);
|
|
|
|
+private:
|
|
+ bool may_iterate;
|
|
}; // class pass_fre
|
|
|
|
unsigned int
|
|
@@ -7248,15 +7258,16 @@ pass_fre::execute (function *fun)
|
|
unsigned todo = 0;
|
|
|
|
/* At -O[1g] use the cheap non-iterating mode. */
|
|
+ bool iterate_p = may_iterate && (optimize > 1);
|
|
calculate_dominance_info (CDI_DOMINATORS);
|
|
- if (optimize > 1)
|
|
+ if (iterate_p)
|
|
loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
|
|
|
|
default_vn_walk_kind = VN_WALKREWRITE;
|
|
- todo = do_rpo_vn (fun, NULL, NULL, optimize > 1, true);
|
|
+ todo = do_rpo_vn (fun, NULL, NULL, iterate_p, true);
|
|
free_rpo_vn ();
|
|
|
|
- if (optimize > 1)
|
|
+ if (iterate_p)
|
|
loop_optimizer_finalize ();
|
|
|
|
return todo;
|