From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73887 invoked by alias); 30 Aug 2019 06:18:57 -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 73879 invoked by uid 89); 30 Aug 2019 06:18:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=crazylht@gmail.com, crazylhtgmailcom, artificially X-HELO: mail-io1-f68.google.com Received: from mail-io1-f68.google.com (HELO mail-io1-f68.google.com) (209.85.166.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Aug 2019 06:18:55 +0000 Received: by mail-io1-f68.google.com with SMTP id n197so9843702iod.9 for ; Thu, 29 Aug 2019 23:18:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qFU1kJ551PeK4U4HhSx6Ei7J6HBbt4CgYONS8p7OJ6Q=; b=cCupas138BZVv3PenrUGfEHW4hJAWSu3z6D7rihY07Yx1JivGXHl9+cTHzqJFr0T18 j7GW53ZZrMrdSm5a4kESQTKXydQP+c71GAxE/pscHm7LUEEPEtV/H+mLj6BSFIX1Bor6 GUozfNqhzGOs5N9TRB321GielgpT9gi0VL3cKgyn1srp8Fs4KbxuP2ea8+bXJRav5dEZ TVGdcK52YHHWhjP8BSbYG8hkQBn2zKK5YpI0zH0HWeB9lSrxrOBZxUPyVKi4OrmA55iT pyaKvHJJbhGTzB31+ImgkidSdcSDmuiIj6ZT5nYGKvXrL6nT+FedgBxtMbqh0Ud7/5rH h0YA== MIME-Version: 1.0 References: In-Reply-To: From: Uros Bizjak Date: Fri, 30 Aug 2019 07:22:00 -0000 Message-ID: Subject: Re: [PATCH, i386]: Do not limit the cost of moves to/from XMM register to minimum 8. To: Hongtao Liu Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-08/txt/msg02030.txt.bz2 On Fri, Aug 30, 2019 at 2:08 AM Hongtao Liu wrote: > > On Fri, Aug 30, 2019 at 2:09 AM Uros Bizjak wrote: > > > > 2019-08-28 Uro=C5=A1 Bizjak > > > > * config/i386/i386.c (ix86_register_move_cost): Do not > > limit the cost of moves to/from XMM register to minimum 8. > > > > Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. > > > > Actually committed as r274994 with the wrong ChangeLog. > > > > Uros. > > There is 11% regression in 548.exchange_r of SPEC2017. > > Reason for the regression: > For 548.exchange_r, a lot of movements between gpr and xmm are > generated as expected, > and it reduced clocksticks by 3%. This is OK, and expected from the patch. > But however maybe too many xmm registers are used, > a frequency reduction issue is triggered(average frequency reduced by 13%= ). > So totally it takes more time. This is a secondary effect that is currently not modelled by the compiler. However, I expected that SSE <-> int moves in x86-tune-cost.h will have to be retuned. Up to now, both directions were limited to minimum 8, so any value lower than 8 was ignored. However, minimum was set to work-around certain limitation in reload, which is not needed anymore. You can simply set the values of SSE <-> int moves to 8 (which is an arbitrary value!) to restore the previous behaviour, but I think that a more precise cost value should be determined, probably a different one for each direction. But until register pressure effects are modelled, any artificially higher value will represent a workaround and not the true reg-reg move cost. Uros.