From patchwork Fri Jun 15 12:40:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 929910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-479798-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="AlU9xS4S"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 416g8S522Bz9s19 for ; Fri, 15 Jun 2018 22:41:11 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=fb6FFVR7uQj8LLmFEk3744CJ+5/vdDsKT1xUdrwQRqUJHU+Kg9mvQ 92e4fAOnYzhXCTZ9ZSAvo7GPqYeIR3G0h8p3OQx79tlKlRM9jRujitJGvHXuqWC4 bQQX+MLsjSKLxufVuxyOt/TUEPlX2mqYWwq4h9wZvyf4WawSIHAHKE= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=/f7A0zeMb7jdnMvljjBt9CJJAUA=; b=AlU9xS4SeXsnevaf5xFC vwS93WKRvGKOUTmGxIL0TdCgupxURbjirvrkq5G5oC98lv2pm4emqy1tXNdOAkxD gPLCVVY4NPMoofm+g0gCiCi8A2sGzMaaWGH5kBExt6W+krzmU/s/qxc4lx89LS8w 8UrfWivcwhO8qRiBSqlkhrc= Received: (qmail 95885 invoked by alias); 15 Jun 2018 12:41:04 -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 95876 invoked by uid 89); 15 Jun 2018 12:41:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:UNKNOWN X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Jun 2018 12:41:02 +0000 Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B8D8CAC31 for ; Fri, 15 Jun 2018 12:40:59 +0000 (UTC) Date: Fri, 15 Jun 2018 14:40:59 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Note which vector size was used in -fopt-info vectorizer message Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 $subject I mainly need this for evaluation right now but I guess it's useful to users as well (where a new target hook could give names to sizes, but well...) Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2018-06-15 Richard Biener * tree-vect-slp.c (vect_slp_bb): Dump MSG_OPTIMIZED_LOCATIONS here, also noting vector size used. * tree-vectorizer.c (vectorize_loops): Adjust. Note vector size used in MSG_OPTIMIZED_LOCATIONS dump. (pass_slp_vectorize::execute): Adjust. diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 930f7086720..3039ae28fb7 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -3037,9 +3037,16 @@ vect_slp_bb (basic_block bb) vect_schedule_slp (bb_vinfo); - if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, - "basic block part vectorized\n"); + unsigned HOST_WIDE_INT bytes; + if (current_vector_size.is_constant (&bytes)) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, + "basic block part vectorized using " + HOST_WIDE_INT_PRINT_UNSIGNED " byte " + "vectors\n", bytes); + else + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, + "basic block part vectorized using variable " + "length vectors\n"); vectorized = true; } diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 8ff90b37ee6..eb9129051b5 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -794,7 +794,7 @@ vectorize_loops (void) } if (! has_mask_load_store && vect_slp_bb (bb)) { - dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, + dump_printf_loc (MSG_NOTE, vect_location, "basic block vectorized\n"); fold_loop_internal_call (loop_vectorized_call, boolean_true_node); @@ -827,10 +827,17 @@ vectorize_loops (void) if (loop_vectorized_call) set_uid_loop_bbs (loop_vinfo, loop_vectorized_call); - if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOCATION - && dump_enabled_p ()) - dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, - "loop vectorized\n"); + + unsigned HOST_WIDE_INT bytes; + if (current_vector_size.is_constant (&bytes)) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, + "loop vectorized vectorized using " + HOST_WIDE_INT_PRINT_UNSIGNED " byte " + "vectors\n", bytes); + else + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, + "loop vectorized using variable length vectors\n"); + new_loop = vect_transform_loop (loop_vinfo); num_vectorized_loops++; /* Now that the loop has been vectorized, allow it to be unrolled @@ -1066,8 +1073,7 @@ pass_slp_vectorize::execute (function *fun) FOR_EACH_BB_FN (bb, fun) { if (vect_slp_bb (bb)) - dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, - "basic block vectorized\n"); + dump_printf_loc (MSG_NOTE, vect_location, "basic block vectorized\n"); } if (!in_loop_pipeline)