From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16271 invoked by alias); 16 Dec 2007 14:33:11 -0000 Received: (qmail 16260 invoked by uid 22791); 16 Dec 2007 14:33:09 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 16 Dec 2007 14:33:00 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id lBGEWvPt063684 for ; Sun, 16 Dec 2007 14:32:57 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id lBGEWvmR2527396 for ; Sun, 16 Dec 2007 15:32:57 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id lBGEWuZY026076 for ; Sun, 16 Dec 2007 15:32:56 +0100 Received: from d12mc102.megacenter.de.ibm.com (d12mc102.megacenter.de.ibm.com [9.149.167.114]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id lBGEWtHs026061; Sun, 16 Dec 2007 15:32:56 +0100 In-Reply-To: Subject: Re: HIRLAM with -ftree-loop-distribution. To: Dorit Nuzman Cc: GCC , Toon Moene , Uros Bizjak X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Dorit Nuzman Date: Sun, 16 Dec 2007 14:54:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00466.txt.bz2 Here's a tentative patch to do that: - removes the confusing printing "not vectorized: vectorization may not be profitable" from REPORT_UNVECTORIZED_LOOPS - instead print "vectorization may not be profitable" under a new verbosity level REPORT_COST - change (hopefully all) other cost-model printings to be printed under REPORT_COST I'll test it later this week. I assume this kind of thing is an ok stage 3 material (it's a regression fix cause this confusion in the dump reports was introduced with the cost model patches during 4.3) dorit --- tree-vect-transform.c 2007-12-16 14:09:20.000000000 +0200 +++ tree-vect-transform.cost_verbose.c 2007-12-16 16:07:09.000000000 +0200 @@ -134,7 +134,7 @@ /* Cost model disabled. */ if (!flag_vect_cost_model) { - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "cost model disabled.");: return 0; } @@ -153,7 +153,7 @@ /* FIXME: Make cost depend on complexity of individual check. */ vec_outside_cost += VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)); - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "cost model: Adding cost of checks for loop " "versioning to treat misalignment.\n"); } @@ -163,7 +163,7 @@ /* FIXME: Make cost depend on complexity of individual check. */ vec_outside_cost += VEC_length (ddr_p, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo));. - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "cost model: Adding cost of checks for loop " "versioning aliasing.\n"); } @@ -224,14 +224,14 @@ if (byte_misalign < 0) { peel_iters_prologue = vf/2; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "cost model: " "prologue peel iters set to vf/2."); /* If peeling for alignment is unknown, loop bound of main loop becomes unknown. */ peel_iters_epilogue = vf/2; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "cost model: " "epilogue peel iters set to vf/2 because " "peeling for alignment is unknown ."); @@ -261,7 +261,7 @@ if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)) { peel_iters_epilogue = vf/2; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "cost model: " "epilogue peel iters set to vf/2 because " "loop iterations are unknown ."); @@ -391,7 +391,7 @@ /* vector version will never be profitable. */ else { - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "cost model: vector iteration cost = %d " "is divisible by scalar iteration cost = %d by a factor " "greater than or equal to the vectorization factor = %d .", @@ -399,7 +399,7 @@ return -1; } - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) { fprintf (vect_dump, "Cost model analysis: \n"); fprintf (vect_dump, " Vector inside of loop cost: %d\n", @@ -425,7 +425,7 @@ then skip the vectorized loop. */ min_profitable_iters--; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, " Profitability threshold = %d\n", min_profitable_iters); @@ -465,7 +465,7 @@ vectype = get_vectype_for_scalar_type (TREE_TYPE (reduction_op)); if (!vectype) { - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) { fprintf (vect_dump, "unsupported data-type "); print_generic_expr (vect_dump, TREE_TYPE (reduction_op), TDF_SLIM); @@ -520,7 +520,7 @@ STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info) = outer_cost; - if (vect_print_dump_info (REPORT_DETAILS))) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_reduction_cost: inside_cost = %d, " "outside_cost = %d .", STMT_VINFO_INSIDE_OF_LOOP_COST (stmt_info), STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info)); @@ -541,7 +541,7 @@ /* prologue cost for vec_init and vec_step. */ STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info) = 2 * TARG_SCALAR_TO_VEC_COST; - if (vect_print_dump_info (REPORT_DETAILS))) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_induction_cost: inside_cost = %d, " "outside_cost = %d .", STMT_VINFO_INSIDE_OF_LOOP_COST (stmt_info), STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info)); @@ -570,7 +570,7 @@ outside_cost += TARG_SCALAR_TO_VEC_COST; } - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_simple_cost: inside_cost = %d, " "outside_cost = %d .", inside_cost, outside_cost);% @@ -628,7 +628,7 @@ inside_cost = ncopies * exact_log2(group_size) * group_size, * TARG_VEC_STMT_COST; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_store_cost: strided group_size = %d .", group_size); @@ -637,7 +637,7 @@ /* Costs of the stores. */ inside_cost += ncopies * TARG_VEC_STORE_COST; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_store_cost: inside_cost = %d, " "outside_cost = %d .", inside_cost, outside_cost); @@ -688,7 +688,7 @@ inside_cost = ncopies * exact_log2(group_size) * group_size * TARG_VEC_STMT_COST; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_load_cost: strided group_size = %d .",, group_size); @@ -701,7 +701,7 @@ { inside_cost += ncopies * TARG_VEC_LOAD_COST; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_load_cost: aligned."); break; @@ -711,7 +711,7 @@ /* Here, we assign an additional cost for the unaligned load. */ inside_cost += ncopies * TARG_VEC_UNALIGNED_LOAD_COST; - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_load_cost: unaligned supported by ",, "hardware."); @@ -731,7 +731,7 @@ } case dr_explicit_realign_optimized: { - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_load_cost: unaligned software " "pipelined."); @@ -758,7 +758,7 @@ gcc_unreachable (); } - if (vect_print_dump_info (REPORT_DETAILS)) + if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_load_cost: inside_cost = %d, " "outside_cost = %d .", inside_cost, outside_cost);, @@ -6552,11 +6552,7 @@ || min_profitable_iters > min_scalar_loop_bound)) th = (unsigned) min_profitable_iters; - if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS)) - fprintf (vect_dump, "not vectorized: vectorization may not be" - "profitable."); - - if (th && vect_print_dump_info (REPORT_DETAILS)) + if (th && vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "Vectorization may not be profitable."); return th; --- tree-vectorizer.h 2007-12-16 16:08:07.000000000 +0200 +++ tree-vectorizer.cost_verbose.h 2007-12-16 16:08:02.000000000 +0200 @@ -73,6 +73,7 @@ REPORT_NONE, REPORT_VECTORIZED_LOOPS, REPORT_UNVECTORIZED_LOOPS, + REPORT_COST, REPORT_ALIGNMENT, REPORT_DR_DETAILS, REPORT_BAD_FORM_LOOPS, Dorit Nuzman/Haifa/IBM@ IBMIL To Sent by: Toon Moene gcc-owner@gcc.gnu .org cc GCC , Uros Bizjak 16/12/2007 16:02 Subject Re: HIRLAM with -ftree-loop-distribution. > Uros Bizjak wrote: > > >> note: not vectorized: vectorization may not beprofitable. > > > > This is due to switching on vector cost model by default for x86. > > Ah, but my hidden critique of the message was: > -ftree-vectorizer-verbose=2 should *only* tell us: > > 1. Which loops are vectorized. > 2. Which are not - and why (in a single sentence). > > For more detailed logging, one should use -ftree-vectorizer-verbose=n > with n>2, IMNSHO. > yes, you are right. this printing should be either removed (as it's anyhow already being printed also under REPORT_DETAILS), or we may want to add a new verbosity level (lower than REPORT_DETAILS) for cost-model info ("REPORT_COST"). dorit > Kind regards, > > -- > Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290 > Saturnushof 14, 3738 XG Maartensdijk, The Netherlands > At home: http://moene.indiv.nluug.nl/~toon/ > GNU Fortran's path to Fortran 2003: http://gcc.gnu.org/wiki/Fortran2003