From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by sourceware.org (Postfix) with ESMTPS id 631963858D38 for ; Tue, 21 Jul 2020 07:58:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 631963858D38 Received: by mail-ej1-x644.google.com with SMTP id rk21so20741183ejb.2 for ; Tue, 21 Jul 2020 00:58:02 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L8g/RHGMAy8saA+G3DyFmc3a+FDr1ITnp+kON2VlyTc=; b=CQXedJ/vd/MmMOP6qTrSmQs0NDHIA3LAvPopy8JAOps/oudgMkY/4jKSyihK/uBIKA UJzPcXBAbF3/Z+5qva0X13a6FGhbSDQD710WIBJ0sIc4FqW0Qdvkq5y0sDSAtA4D3X5O 6Ap5xk7w8t74Igdld1JUvJv0gM2O/ae69jpnOZTjYVd2/mhqdhmYPOjQ6mMFbhgXnW2T cQJBATvsLhRp3NATmIdpeHF9vZ283w8DuuMehCV4HSFboDeOV8OQHSAfgYPNzF6qcgPs lP2OVggX3BwBq+UAnhDFYBzk7wW6ztUR46Fyk1Yu8YBXDYFoPOwwmgafLNhc691oqsND /xUQ== X-Gm-Message-State: AOAM531mOmmpClbMriTXpPAO3PIvwBEspVgpq8v8ZEQfOyKItDBvUgK1 dTZlx02nrJx8PJcgZCldZ6w/i2IHvwGjDNOAOLw= X-Google-Smtp-Source: ABdhPJzDX9fXWeO4I/ouGM9X6njXS4kZat16Y2FsGrcgHNCK5omKP+sI1SLgHwWrRopJ9cLPqJIpoXmnFB0gztWT6MA= X-Received: by 2002:a17:906:384a:: with SMTP id w10mr25327075ejc.235.1595318281334; Tue, 21 Jul 2020 00:58:01 -0700 (PDT) MIME-Version: 1.0 References: <419f1fad-05be-115c-1a53-cb710ae7b2dc@linux.ibm.com> In-Reply-To: <419f1fad-05be-115c-1a53-cb710ae7b2dc@linux.ibm.com> From: Richard Biener Date: Tue, 21 Jul 2020 09:57:50 +0200 Message-ID: Subject: Re: [PATCH] vect: Support vector with length cost modeling To: "Kewen.Lin" Cc: GCC Patches , Bill Schmidt , Segher Boessenkool , Richard Sandiford Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 07:58:04 -0000 On Tue, Jul 21, 2020 at 7:52 AM Kewen.Lin wrote: > > Hi, > > This patch is to add the cost modeling for vector with length, > it mainly follows what we generate for vector with length in > functions vect_set_loop_controls_directly and vect_gen_len > at the worst case. > > For Power, the length is expected to be in bits 0-7 (high bits), > we have to model the cost of shifting bits. To allow other targets > not suffer this, I used one target hook to describe this extra cost, > I'm not sure if it's a correct way. > > Bootstrapped/regtested on powerpc64le-linux-gnu (P9) with explicit > param vect-partial-vector-usage=1. > > Any comments/suggestions are highly appreciated! I don't like the introduction of an extra target hook for this. All vectorizer cost modeling should ideally go through init_cost/add_stmt_cost/finish_cost. If the extra costing is not per stmt then either init_cost or finish_cost is appropriate. Currently init_cost only gets a struct loop while we should probably give it a vec_info * parameter so targets can check LOOP_VINFO_USING_PARTIAL_VECTORS_P and friends. Richard. > BR, > Kewen > ----- > gcc/ChangeLog: > > * config/rs6000/rs6000.c (TARGET_VECTORIZE_EXTRA_LENGTH_COST): New > macro. > * doc/tm.texi: Regenerate. > * doc/tm.texi.in (TARGET_VECTORIZE_EXTRA_LENGTH_COST): New target hook. > * target.def (extra_length_cost): Likewise. > * tree-vect-loop.c (vect_estimate_min_profitable_iters): Add cost > modeling for vector with length.