From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110304 invoked by alias); 7 Dec 2019 17:44:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 110296 invoked by uid 89); 7 Dec 2019 17:44:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=Das X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 07 Dec 2019 17:44:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575740660; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S/O/UxQuaMmyM5UJpbEq/VTHxnt/DE0+2VXcTGpK7AA=; b=WNYFH/vbahMX/Fp/sX804ZxptQR1O8nc2FLnkRasptwz129trTwcmiqN6C7UFxI+9daVJJ inHG7FSuUXeK0g+GXKlmLv29b9OSed8LKR8xMR5JE8YMeVCnTF+2Ch318NEGItdGP5dCNz SoALM8m91yPlO+zWh/LhZ+zazpCRgEs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-181-RuJjYQJLN_CdyKAYinW9DQ-1; Sat, 07 Dec 2019 12:44:17 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA2F818543A1; Sat, 7 Dec 2019 17:44:15 +0000 (UTC) Received: from ovpn-112-27.phx2.redhat.com (ovpn-112-27.phx2.redhat.com [10.3.112.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10E4E5C21A; Sat, 7 Dec 2019 17:44:14 +0000 (UTC) Message-ID: Subject: Re: Fwd: [PATCH, GCC, Vect] Fix costing for vector shifts From: Jeff Law Reply-To: law@redhat.com To: Sudakshina Das , "gcc-patches@gcc.gnu.org" Cc: Richard Sandiford , Richard Biener Date: Sat, 07 Dec 2019 17:44:00 -0000 In-Reply-To: References: User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00516.txt.bz2 On Fri, 2019-12-06 at 14:05 +0000, Sudakshina Das wrote: > Hi > > While looking at the vectorization for following example, we > realized > that even though vectorizable_shift function was distinguishing > vector > shifted by vector from vector shifted by scalar, while modeling the > cost > it would always add the cost of building a vector constant despite > not > needing it for vector shifted by scalar. > > This patch fixes this by using scalar_shift_arg to determine whether > we > need to build a vector for the second operand or not. This reduces > prologue cost as shown in the test. > > Build and regression tests pass on aarch64-none-elf and > x86_64-pc-linux-gnu-gcc. This gives a 3.42% boost to 525.x264_r in > Spec2017 for AArch64. > > gcc/ChangeLog: > > 2019-xx-xx Sudakshina Das > Richard Sandiford > > * tree-vect-stmt.c (vectorizable_shift): Condition ndts for > vect_model_simple_cost call on scalar_shift_arg. > > gcc/testsuite/ChangeLog: > > 2019-xx-xx Sudakshina Das > > * gcc.dg/vect/vect-shift-5.c: New test. It's a bit borderline, but it's really just twiddling a cost, so OK. jeff