From patchwork Thu May 11 12:44:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 761055 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wNt9R4BDKz9ryr for ; Thu, 11 May 2017 22:44:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Wm8EIpyx"; dkim-atps=neutral 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:from:date:message-id :subject:to:cc:content-type; q=dns; s=default; b=CAFbYuZQdY9LsWj 6B+ApBS9DBsGFE5gMmPhQJHSSK+gW9QG4ieen2Qx2MuVBZDfZ46AWzS71vU8wkHo Z6NCAEiIDQ//rVyp+l0tT8v8f9aLRq0D0UE7cqn7iGzp6QQ1/OmD0wx61nEQVVLO uMe0gtJar70cCk9OzFWrMVySF+nU= 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:from:date:message-id :subject:to:cc:content-type; s=default; bh=FQaldp9EYRPNAgFHEZKDh aNXEE4=; b=Wm8EIpyxg61kGt/Ol+xX4glhlQreICct3BiHBW5vAdFbYpXcDO+Yq PL6pfBmhU1B0HjlHirv8ZyYu93DqGunBF3X8fPOauEAiMRtWXibefE6hiyxHLT4x ojmjcrsUOekMAcRUw6DOECFTIu0KnfIMOfmdTr+7dOY1xm+xIg43eA= Received: (qmail 61362 invoked by alias); 11 May 2017 12:44:47 -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 61345 invoked by uid 89); 11 May 2017 12:44:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:ZxOwgAV, H*f:sk:XHfYnG1, H*i:sk:ZxOwgAV, H*i:sk:XHfYnG1 X-HELO: mail-oi0-f41.google.com Received: from mail-oi0-f41.google.com (HELO mail-oi0-f41.google.com) (209.85.218.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 May 2017 12:44:40 +0000 Received: by mail-oi0-f41.google.com with SMTP id w10so28475080oif.0 for ; Thu, 11 May 2017 05:44:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hMBGrTObcp+n50TPJSIOUf7u0ApAt50RAnUr0PoWeqU=; b=mGYqnaVykzmDW6pssnLqPTJ9Cv9yBJII6isQhh/d2b0Q1YwJ4tCLSNVSCauAdSsnYG DEMLLrI4lABgVfeWnVBSGNtWt79TbGt4Juboq2+kQetmg6uNV2qPb5hDNg105UFkiyH/ il7K5TDPcD4gb/MCYuroxBcwaa+cB7D1Omm1R949mJsjMlibYXyJl0juVr8igOPQ/0oR UxK+kwMx0zr83vLLnTC/htjNCMCw54LMePAmxo2itv2sroK67vV5AOF35ZZOnWkSUsCO 2klxFbek4iPybRhR6cDM6rM5YmYtz3soVErRDORJ/qcRT4Rl5tvwpA7TyeKhEdNsXsA8 fMFw== X-Gm-Message-State: AODbwcB4eESRHaxbiRkSMkV7f4EqYOncD75V5+FjuF2oHFOJrkVpiQN5 WQwV+fMJRhf6Or1k9ihfJml8Y2Ccwg== X-Received: by 10.202.77.8 with SMTP id a8mr55089oib.128.1494506681861; Thu, 11 May 2017 05:44:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.51.83 with HTTP; Thu, 11 May 2017 05:44:41 -0700 (PDT) In-Reply-To: References: <0296a54f-cb8d-d9b8-380a-9cc553dbb6da@linux.vnet.ibm.com> <2804E9EF-67D1-4EFD-AF29-65C634EBE24F@gmail.com> <6f1194a0-9e57-0028-faf4-6190beec2009@linux.vnet.ibm.com> <3e575f6d-874a-b260-1fc2-f4db1250c32b@linux.vnet.ibm.com> From: Richard Biener Date: Thu, 11 May 2017 14:44:41 +0200 Message-ID: Subject: Re: [RFC] S/390: Alignment peeling prolog generation To: Robin Dapp Cc: GCC Patches , "Bin.Cheng" X-IsSubscribed: yes On Thu, May 11, 2017 at 2:15 PM, Richard Biener wrote: > On Thu, May 11, 2017 at 2:14 PM, Richard Biener > wrote: >> On Thu, May 11, 2017 at 1:15 PM, Robin Dapp wrote: >>> Included the requested changes in the patches (to follow). I removed >>> the alignment count check now altogether. >>> >>>> I'm not sure why you test for unlimited_cost_model here as I said >>>> elsewhere I'm not sure >>>> what not cost modeling means for static decisions. The purpose of >>>> unlimited_cost_model >>>> is to always vectorize when possible and omit the runtime >>>> profitability check. So for peeling >>>> I'd just always use the cost model. Thus please drop this check. >>> >>> Without that, I get one additional FAIL gcc.dg/vect/slp-25.c for x86. >>> It is caused by choosing no peeling (inside costs 0) over peeling for >>> known alignment with unlimited cost model (inside costs 0 as well). >>> Costs 0 for no peeling are caused by count == 0 or rather ncopies = vf / >>> nunits == 4 / 8 == 0 in record_stmt_costs (). Shouldn't always hold >>> ncopies > 0? Even 0.5 would have worked here to make no peeling more >>> expensive than 0. >> >> That's odd. I can't get >> >> Index: gcc/tree-vect-stmts.c >> =================================================================== >> --- gcc/tree-vect-stmts.c (revision 247882) >> +++ gcc/tree-vect-stmts.c (working copy) >> @@ -95,6 +96,7 @@ record_stmt_cost (stmt_vector_for_cost * >> enum vect_cost_for_stmt kind, stmt_vec_info stmt_info, >> int misalign, enum vect_cost_model_location where) >> { >> + gcc_assert (count > 0); >> if (body_cost_vec) >> { >> tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE; >> >> to ICE with the testcase (unpatched trunk) >> >> Where's that record_stmt_cost call done? You can't simply use vf/nunits >> for SLP. > > Ah, of course needs -fvect-cost-model. > > I'll investigate. Ugh. The vect_peeling_hash_get_lowest_cost isn't handling SLP in any way, there's quite some refactoring necessary to fix that. I suggest (eh) to do > Richard. > >> Richard. >> >>> Test suite on s390x is clean. >>> >>> Regards >>> Robin >>> Index: gcc/tree-vect-data-refs.c =================================================================== --- gcc/tree-vect-data-refs.c (revision 247734) +++ gcc/tree-vect-data-refs.c (working copy) @@ -1129,7 +1129,7 @@ vect_get_data_access_cost (struct data_r int nunits = TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info)); loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo); - int ncopies = vf / nunits; + int ncopies = MAX (1, vf / nunits); /* TODO: Handle SLP properly */ if (DR_IS_READ (dr)) vect_get_load_cost (dr, ncopies, true, inside_cost, outside_cost,