diff options
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 72 |
1 files changed, 51 insertions, 21 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 4217f2be54c..8ed0fc58c59 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "target.h" #include "basic-block.h" #include "gimple-pretty-print.h" -#include "tree-flow.h" +#include "tree-ssa.h" #include "tree-pass.h" #include "cfgloop.h" #include "expr.h" @@ -257,6 +257,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: can't find def for "); dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } return false; @@ -283,6 +284,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "Build SLP failed: some of the stmts" " are in a pattern, and others are not "); dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } return false; @@ -295,7 +297,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "Unsupported pattern."); + "Unsupported pattern.\n"); return false; } @@ -312,7 +314,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, default: if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "unsupported defining stmt: "); + "unsupported defining stmt:\n"); return false; } } @@ -342,7 +344,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "Build SLP failed: different types "); + "Build SLP failed: different types\n"); return false; } @@ -367,6 +369,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: illegal type of def "); dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, def); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } return false; @@ -415,6 +418,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, { dump_printf_loc (MSG_NOTE, vect_location, "Build SLP for "); dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0); + dump_printf (MSG_NOTE, "\n"); } /* Fail to vectorize statements marked as unvectorizable. */ @@ -425,6 +429,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: unvectorizable statement "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -440,6 +445,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "Build SLP failed: not GIMPLE_ASSIGN nor " "GIMPLE_CALL "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -457,6 +463,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "Build SLP failed: condition is not " "comparison "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -473,6 +480,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "Build SLP failed: unsupported data-type "); dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, scalar_type); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -501,6 +509,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: unsupported call type "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -538,7 +547,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "Build SLP failed: no optab."); + "Build SLP failed: no optab.\n"); /* Fatal mismatch. */ matches[0] = false; return false; @@ -549,7 +558,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: " - "op not supported by target."); + "op not supported by target.\n"); /* Fatal mismatch. */ matches[0] = false; return false; @@ -588,6 +597,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "Build SLP failed: different operation " "in stmt "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Mismatch. */ continue; @@ -602,6 +612,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "Build SLP failed: different shift " "arguments in "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Mismatch. */ continue; @@ -622,6 +633,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "Build SLP failed: different calls in "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Mismatch. */ continue; @@ -661,6 +673,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "loads have gaps "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -685,6 +698,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "the SLP group size "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -707,6 +721,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "interleaving chains in one node "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Mismatch. */ continue; @@ -731,6 +746,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "unaligned load "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -749,6 +765,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: not grouped load "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* FORNOW: Not grouped loads are not supported. */ @@ -769,6 +786,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, "Build SLP failed: operation"); dump_printf (MSG_MISSED_OPTIMIZATION, " unsupported "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Fatal mismatch. */ matches[0] = false; @@ -790,6 +808,7 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, " operation"); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } /* Mismatch. */ continue; @@ -1076,6 +1095,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn) else for (i = 0; i < group_size; ++i) dump_printf (MSG_NOTE, "%d ", i); + dump_printf (MSG_NOTE, "\n"); } /* In case of reduction every load permutation is allowed, since the order @@ -1187,6 +1207,7 @@ vect_supported_load_permutation_p (slp_instance slp_instn) "unsupported unaligned load "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, first_load, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } return false; } @@ -1449,6 +1470,7 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: unsupported data-type "); dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, scalar_type); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } return false; @@ -1465,9 +1487,9 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, if (unrolling_factor != 1 && !loop_vinfo) { if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: unrolling required in basic" - " block SLP"); + " block SLP\n"); return false; } @@ -1514,9 +1536,9 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, if (unrolling_factor != 1 && !loop_vinfo) { if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: unrolling required in basic" - " block SLP"); + " block SLP\n"); vect_free_slp_tree (node); loads.release (); return false; @@ -1567,10 +1589,11 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, { if (dump_enabled_p ()) { - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "Build SLP failed: unsupported load " "permutation "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } vect_free_slp_instance (new_instance); return false; @@ -1618,7 +1641,7 @@ vect_analyze_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) bool ok = false; if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, "=== vect_analyze_slp ==="); + dump_printf_loc (MSG_NOTE, vect_location, "=== vect_analyze_slp ===\n"); if (loop_vinfo) { @@ -1638,7 +1661,7 @@ vect_analyze_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "Failed to SLP the basic block."); + "Failed to SLP the basic block.\n"); return false; } @@ -1680,7 +1703,8 @@ vect_make_slp_decision (loop_vec_info loop_vinfo) int decided_to_slp = 0; if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, "=== vect_make_slp_decision ==="); + dump_printf_loc (MSG_NOTE, vect_location, "=== vect_make_slp_decision ===" + "\n"); FOR_EACH_VEC_ELT (slp_instances, i, instance) { @@ -1699,7 +1723,7 @@ vect_make_slp_decision (loop_vec_info loop_vinfo) if (decided_to_slp && dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, - "Decided to SLP %d instances. Unrolling factor %d", + "Decided to SLP %d instances. Unrolling factor %d\n", decided_to_slp, unrolling_factor); return (decided_to_slp > 0); @@ -1763,7 +1787,8 @@ vect_detect_hybrid_slp (loop_vec_info loop_vinfo) slp_instance instance; if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, "=== vect_detect_hybrid_slp ==="); + dump_printf_loc (MSG_NOTE, vect_location, "=== vect_detect_hybrid_slp ===" + "\n"); FOR_EACH_VEC_ELT (slp_instances, i, instance) vect_detect_hybrid_slp_stmts (SLP_INSTANCE_TREE (instance)); @@ -2016,7 +2041,7 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo) vec_inside_cost); dump_printf (MSG_NOTE, " Vector prologue cost: %d\n", vec_prologue_cost); dump_printf (MSG_NOTE, " Vector epilogue cost: %d\n", vec_epilogue_cost); - dump_printf (MSG_NOTE, " Scalar cost of basic block: %d", scalar_cost); + dump_printf (MSG_NOTE, " Scalar cost of basic block: %d\n", scalar_cost); } /* Vectorization is profitable if its cost is less than the cost of scalar @@ -2135,7 +2160,7 @@ vect_slp_analyze_bb_1 (basic_block bb) if (!vect_slp_analyze_operations (bb_vinfo)) { if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "not vectorized: bad operation in basic block.\n"); destroy_bb_vec_info (bb_vinfo); @@ -2239,7 +2264,7 @@ vect_update_slp_costs_according_to_vf (loop_vec_info loop_vinfo) if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, - "=== vect_update_slp_costs_according_to_vf ==="); + "=== vect_update_slp_costs_according_to_vf ===\n"); FOR_EACH_VEC_ELT (slp_instances, i, instance) { @@ -2739,9 +2764,10 @@ vect_get_mask_element (gimple stmt, int first_mask_element, int m, { if (dump_enabled_p ()) { - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "permutation requires at least two vectors "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } return false; @@ -2761,6 +2787,7 @@ vect_get_mask_element (gimple stmt, int first_mask_element, int m, "permutation requires at " "least three vectors "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } return false; @@ -2828,6 +2855,7 @@ vect_transform_slp_perm_load (slp_tree node, vec<tree> dr_chain, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "no vect permute for "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); + dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } return false; } @@ -2998,6 +3026,7 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance, dump_printf_loc (MSG_NOTE,vect_location, "------>vectorizing SLP node starting from: "); dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0); + dump_printf (MSG_NOTE, "\n"); } /* Loads should be inserted before the first load. */ @@ -3104,7 +3133,7 @@ vect_schedule_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) instance, vf); if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, - "vectorizing stmts using SLP."); + "vectorizing stmts using SLP.\n"); } FOR_EACH_VEC_ELT (slp_instances, i, instance) @@ -3168,6 +3197,7 @@ vect_slp_transform_bb (basic_block bb) dump_printf_loc (MSG_NOTE, vect_location, "------>SLPing statement: "); dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0); + dump_printf (MSG_NOTE, "\n"); } stmt_info = vinfo_for_stmt (stmt); |