From patchwork Wed Aug 28 18:14:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinliang David Li X-Patchwork-Id: 270614 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 339182C00A4 for ; Thu, 29 Aug 2013 04:15:07 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=MAzmZQy+bcA3gBdysY Q5oBcwpVpWP65ublQeisLL3sH6WIfMmKcGPMlZ4o27rkbPa9Rx6y3bcZ1QtD2aOo aHeTHmXWcTCQl18So9ed7mzcCAByMZ3LtgK1BZQevGsD2XNL1yNbHOBeyDqwp9hz 3TSD2TBfp+6xT5muxxqh/LdiQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=z5t9A+PHggJPQ+Z3Opb7BUMa MXM=; b=o9SaEDQuJJJHq6Xp1Ln01iK4LeexsJr5tGnqEUXIuRQMnPijVy3dniHg cxQhB1xbJrCpJWOSRAjonrjbHZ6iXtS9vVgiXrckYTPlwCfv7O2I6Ue7HEiH0sV3 AXKnZFpMy07l3SKDgmAeSW9bgUWGJV9MOZa5shkHCAT64HM7Etc= Received: (qmail 25483 invoked by alias); 28 Aug 2013 18:15:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25474 invoked by uid 89); 28 Aug 2013 18:15:00 -0000 Received: from mail-wg0-f53.google.com (HELO mail-wg0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 28 Aug 2013 18:15:00 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f53.google.com Received: by mail-wg0-f53.google.com with SMTP id n12so399221wgh.8 for ; Wed, 28 Aug 2013 11:14:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/vXnnVeMiFktEz6lc5P8PGJvdJ76tlN/hAxAtoBzGwE=; b=bBH9ArTzjSyk3H5xi+ukjeQfZGPJi0k7zIw99Yy8zQTy/Usq8ki77Wr6HaGrmd74Fy AB6t/YdP9ojbtd7w+QDmT9IzjhWUC4NqXyIHylYRYsS9T4K4bdAuydQuKo2TJZY7FHNA ub1ri85SlcHzIRSs7wZVYI9xmw9HPnIKv/FWa+Dudkn8MLQVDhADPvbOtcXPBt21ezgW X5Uq1+AIWLP/hcPOtGwcyGEzklivSWoCRJgyZeywptKDgdbplzVQkrb76s6KmV55fXlj QrWqdz9dzwYi6PbYIkwB3ZwB9fEQG0msThtXM+yN0EltNZK/72ZSp2AqhkrIPUrMZ0nU hATg== X-Gm-Message-State: ALoCoQmrhKuhlycmEcbk6GYil/ppHDmkRZe9PXMG6eSAlPfHtZhKBKpx+OceduCqcKUiwlx1gXLbpbUxR4iUUt6K++ZotARonpXeJwdpNe6cLI6/js+x0/hH5aXGiMYRMVVfmH/QrpZVDj9stervUBS15SV3M+2hErwQ2KSN3MduGm9NVCkjGujdkOtwZL3CU2H5FOCMNZnNtwLqfVzAxiwuQZ3Zc2OhZw== MIME-Version: 1.0 X-Received: by 10.195.13.45 with SMTP id ev13mr21956260wjd.20.1377713695941; Wed, 28 Aug 2013 11:14:55 -0700 (PDT) Received: by 10.180.212.81 with HTTP; Wed, 28 Aug 2013 11:14:55 -0700 (PDT) In-Reply-To: References: Date: Wed, 28 Aug 2013 11:14:55 -0700 Message-ID: Subject: Re: opt-info message change for vectorizer From: Xinliang David Li To: Richard Biener Cc: Mike Stump , GCC Patches , Teresa Johnson Fixed as requested. I don't like the extra newline either, but I will leave that to Teresa. basic3.c:8:foo: note: loop vectorized basic3.c:8:foo: note: loop versioned for vectorization because of possible aliasing basic3.c:8:foo: note: loop peeled for vectorization to enhance alignment basic3.c:8:foo: note: loop with 7 iterations completely unrolled basic3.c:5:foo: note: loop with 7 iterations completely unrolled Is this version ok after testing? thanks, David On Wed, Aug 28, 2013 at 2:45 AM, Richard Biener wrote: > On Tue, Aug 27, 2013 at 10:30 PM, Xinliang David Li wrote: >> If this is the convention, we should probably have another patch to >> fix all the existing opt-info messages. > > Yes please. > > Also ... > > >>>>> b.c:16:A::foo: note: Loop is vectorized > > "loop vectorized" > >>>>> >>>>> b.c:16:A::foo: note: Loop is versioned to remove aliases for vectorization > > "loop versioned for vectorization because of possible aliasing" > >>>>> b.c:16:A::foo: note: Loop is peeled to enhance alignment for vectorization > > "loop peeled for vectorization to enhance alignment" > >>>>> b.c:16:A::foo: note: Completely unroll loop 6 times > > maybe "loop with 6 iterations completely unrolled" > >>>>> >>>>> b.c:12:A::foo: note: Completely unroll loop 6 times >>>>> > > I hate the excessive vertical spacing as well. > > Richard. > >>>>> Ok after testing? >>>>> >>>>> thanks, >>>>> >>>>> David >>> Index: tree-vectorizer.c =================================================================== --- tree-vectorizer.c (revision 201751) +++ tree-vectorizer.c (working copy) @@ -119,7 +119,7 @@ vectorize_loops (void) if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC && dump_enabled_p ()) dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, - "Vectorized loop\n"); + "loop vectorized\n"); vect_transform_loop (loop_vinfo); num_vectorized_loops++; } @@ -180,7 +180,7 @@ execute_vect_slp (void) vect_slp_transform_bb (bb); if (dump_enabled_p ()) dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, - "Vectorized basic-block\n"); + "Basic block is vectorized\n"); } } Index: loop-unroll.c =================================================================== --- loop-unroll.c (revision 201751) +++ loop-unroll.c (working copy) @@ -225,7 +225,7 @@ report_unroll_peel (struct loop *loop, l && !loop->lpt_decision.times) { dump_printf_loc (report_flags, locus, - "Turned loop into non-loop; it never loops.\n"); + "loop turned into non-loop; it never loops.\n"); return; } @@ -236,13 +236,16 @@ report_unroll_peel (struct loop *loop, l else if (loop->header->count) niters = expected_loop_iterations (loop); - dump_printf_loc (report_flags, locus, - "%s loop %d times", - (loop->lpt_decision.decision == LPT_PEEL_COMPLETELY - ? "Completely unroll" - : (loop->lpt_decision.decision == LPT_PEEL_SIMPLE - ? "Peel" : "Unroll")), - loop->lpt_decision.times); + if (loop->lpt_decision.decision == LPT_PEEL_COMPLETELY) + dump_printf_loc (report_flags, locus, + "loop with %d iterations completely unrolled", + loop->lpt_decision.times + 1); + else + dump_printf_loc (report_flags, locus, + "loop %s %d times", + (loop->lpt_decision.decision == LPT_PEEL_SIMPLE + ? "peeled" : "unrolled"), + loop->lpt_decision.times); if (profile_info) dump_printf (report_flags, " (header execution count %d", Index: dumpfile.c =================================================================== --- dumpfile.c (revision 201751) +++ dumpfile.c (working copy) @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. #include "dumpfile.h" #include "gimple-pretty-print.h" #include "tree.h" +#include "gimple.h" /* If non-NULL, return one past-the-end of the matching SUBPART of the WHOLE string. */ @@ -261,12 +262,20 @@ dump_loc (int dump_kind, FILE *dfile, so if (dump_kind) { if (LOCATION_LOCUS (loc) > BUILTINS_LOCATION) - fprintf (dfile, "\n%s:%d: note: ", LOCATION_FILE (loc), - LOCATION_LINE (loc)); + { + if (current_function_decl) + fprintf (dfile, "\n%s:%d:%s: note: ", LOCATION_FILE (loc), + LOCATION_LINE (loc), + gimple_decl_printable_name (current_function_decl, 1)); + else + fprintf (dfile, "\n%s:%d: note: ", LOCATION_FILE (loc), + LOCATION_LINE (loc)); + } else if (current_function_decl) - fprintf (dfile, "\n%s:%d: note: ", + fprintf (dfile, "\n%s:%d:%s: note: ", DECL_SOURCE_FILE (current_function_decl), - DECL_SOURCE_LINE (current_function_decl)); + DECL_SOURCE_LINE (current_function_decl), + gimple_decl_printable_name (current_function_decl, 1)); } } Index: ChangeLog =================================================================== --- ChangeLog (revision 201752) +++ ChangeLog (working copy) @@ -1,3 +1,13 @@ +2013-08-22 Xinliang David Li + + * tree-vect-loop-manip.c (vect_do_peeling_for_alignment): + Emit alignment peeling message with default -fopt-info. + (vect_loop_versioning): Emit loop version info message. + * tree-vectorizer.c (vectorize_loops): Minor message + change. + (execute_vect_slp): Ditto. + * dumpfile.c (dump_loc): Add function name in the dump. + 2013-08-14 Xinliang David Li * config/i386/i386.c (ix86_option_override_internal): Index: tree-vect-loop-manip.c =================================================================== --- tree-vect-loop-manip.c (revision 201751) +++ tree-vect-loop-manip.c (working copy) @@ -2021,8 +2021,9 @@ vect_do_peeling_for_alignment (loop_vec_ int bound = 0; if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, - "=== vect_do_peeling_for_alignment ==="); + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, + "loop peeled for vectorization to enhance" + " alignment\n"); initialize_original_copy_tables (); @@ -2404,6 +2405,8 @@ vect_loop_versioning (loop_vec_info loop unsigned prob = 4 * REG_BR_PROB_BASE / 5; gimple_seq gimplify_stmt_list = NULL; tree scalar_loop_iters = LOOP_VINFO_NITERS (loop_vinfo); + bool version_align = LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT (loop_vinfo); + bool version_alias = LOOP_REQUIRES_VERSIONING_FOR_ALIAS (loop_vinfo); if (check_profitability) { @@ -2413,11 +2416,11 @@ vect_loop_versioning (loop_vec_info loop is_gimple_condexpr, NULL_TREE); } - if (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT (loop_vinfo)) + if (version_align) vect_create_cond_for_align_checks (loop_vinfo, &cond_expr, &cond_expr_stmt_list); - if (LOOP_REQUIRES_VERSIONING_FOR_ALIAS (loop_vinfo)) + if (version_alias) vect_create_cond_for_alias_checks (loop_vinfo, &cond_expr); cond_expr = force_gimple_operand_1 (cond_expr, &gimplify_stmt_list, @@ -2427,6 +2430,20 @@ vect_loop_versioning (loop_vec_info loop initialize_original_copy_tables (); loop_version (loop, cond_expr, &condition_bb, prob, prob, REG_BR_PROB_BASE - prob, true); + + if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC + && dump_enabled_p ()) + { + if (version_alias) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, + "loop versioned for vectorization because of " + "possible aliasing\n"); + if (version_align) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, + "loop versioned for vectorization to enhance " + "alignment\n"); + + } free_original_copy_tables(); /* Loop versioning violates an assumption we try to maintain during Index: tree-vect-data-refs.c =================================================================== --- tree-vect-data-refs.c (revision 201751) +++ tree-vect-data-refs.c (working copy) @@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. #include "tree-scalar-evolution.h" #include "tree-vectorizer.h" #include "diagnostic-core.h" - +#include /* Need to include rtl.h, expr.h, etc. for optabs. */ #include "expr.h" #include "optabs.h" @@ -1393,6 +1393,8 @@ vect_enhance_data_refs_alignment (loop_v supportable_dr_alignment = vect_supportable_dr_alignment (dr, true); do_peeling = vector_alignment_reachable_p (dr); + if (getenv("NOPEEL")) + do_peeling = false; if (do_peeling) { if (known_alignment_for_access_p (dr)) Index: tree-ssa-loop-ivcanon.c =================================================================== --- tree-ssa-loop-ivcanon.c (revision 201751) +++ tree-ssa-loop-ivcanon.c (working copy) @@ -870,11 +870,12 @@ try_unroll_loop_completely (struct loop { if (!n_unroll) dump_printf_loc (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, locus, - "Turned loop into non-loop; it never loops.\n"); + "loop turned into non-loop; it never loops.\n"); else { dump_printf_loc (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, locus, - "Completely unroll loop %d times", (int)n_unroll); + "loop with %d iterations completely unrolled", + (int) (n_unroll + 1)); if (profile_info) dump_printf (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, " (header execution count %d)",