From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 54CA6395B41F for ; Tue, 31 May 2022 16:28:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 54CA6395B41F Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-111-FoCDCVDRPF6n9jwB5QMn9g-1; Tue, 31 May 2022 12:28:15 -0400 X-MC-Unique: FoCDCVDRPF6n9jwB5QMn9g-1 Received: by mail-qv1-f71.google.com with SMTP id dw10-20020a0562140a0a00b004644636cc8fso5080852qvb.22 for ; Tue, 31 May 2022 09:28:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=QhXxgBch8E3k62HE7Fr8wXThTCbO+iJ6UTlgWEs+2vc=; b=uZc/xK8+PgIqSr816NqKI3vuwU34RcWvuS3AgoLyVMLe98urQ9r1siUR1zwq7Bt7Y6 glDp8GiqLchLmItrU6SYy4sySwEwGChAtj1p+ko5wWZ2dReVVK3ZKVSXmGeNo9hRqI34 1qmZqaPuJsFPtM367IfQFtSdmX6NwD7nb9mG3e9yEVS27d52XJ1JHtTUUc9wOPIu3EaE SojOfNuKpy4+lgCXA0ZnvFv5LVpWjVnLq66qNWUNcSOdR49WeHsL6V09pfmUdJ3gNuoD b2nZvDBZEktFSi62ea/BndMcEbCFPkw76PpeiBy5VhiMkEdpx6ORkPJCSRpzuraZuNxk 0Pjw== X-Gm-Message-State: AOAM532UnHQxTINE6pWRXRPaEcH4dN9Fpq1S27wnFaiNqdFfsRz2Lb4T vgj7eNMV8ppHzpbNWE+ag+fJdsUqxw1g1glZM351V3tzuiuTiOAGYtCngQWcAGnbrYcq9PSVKE6 3J2LC7x6WqYvr3SkmYw== X-Received: by 2002:ac8:5d49:0:b0:2fa:cdf8:482f with SMTP id g9-20020ac85d49000000b002facdf8482fmr27452625qtx.393.1654014494935; Tue, 31 May 2022 09:28:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUW0uUv2Zrl77i2N4OduuysKXTaTH+3ebyj0sxG+XjpsXTF3eykHHU1qOkhNmmCKC7onu5uQ== X-Received: by 2002:ac8:5d49:0:b0:2fa:cdf8:482f with SMTP id g9-20020ac85d49000000b002facdf8482fmr27452591qtx.393.1654014494472; Tue, 31 May 2022 09:28:14 -0700 (PDT) Received: from [192.168.1.113] ([69.165.238.126]) by smtp.gmail.com with ESMTPSA id j5-20020a37b905000000b006a6490068b2sm2468799qkf.57.2022.05.31.09.28.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 09:28:13 -0700 (PDT) Message-ID: <675684ae-6b28-2cc9-d582-7b5e507d70d5@redhat.com> Date: Tue, 31 May 2022 12:28:12 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] Add a bit dislike for separate mem alternative when op is REG_P. To: Hongtao Liu Cc: liuhongt , GCC Patches References: <20220525033920.77449-1-hongtao.liu@intel.com> <8b505a07-64bb-f483-63cc-cef6e8e4642c@redhat.com> From: Vladimir Makarov In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 31 May 2022 16:28:18 -0000 On 2022-05-29 23:05, Hongtao Liu wrote: > On Fri, May 27, 2022 at 5:12 AM Vladimir Makarov via Gcc-patches > wrote: >> >> On 2022-05-24 23:39, liuhongt wrote: >>> Rigt now, mem_cost for separate mem alternative is 1 * frequency which >>> is pretty small and caused the unnecessary SSE spill in the PR, I've tried >>> to rework backend cost model, but RA still not happy with that(regress >>> somewhere else). I think the root cause of this is cost for separate 'm' >>> alternative cost is too small, especially considering that the mov cost >>> of gpr are 2(default for REGISTER_MOVE_COST). So this patch increase mem_cost >>> to 2*frequency, also increase 1 for reg_class cost when m alternative. >>> >>> >>> Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. >>> Ok for trunk? >> Thank you for addressing this problem. And sorry I can not approve this >> patch at least w/o your additional work on benchmarking this change. >> >> This code is very old. It is coming from older RA (former file >> regclass.c) and existed practically since GCC day 1. People tried many >> times to improve this code. The code also affects many targets. > Yes, that's why I increased it as low as possible, so it won't regress > #c6 in the PR. >> I can approve this patch if you show that there is no regression at >> least on x86-64 on some credible benchmark, e.g. SPEC2006 or SPEC2017. >> > I've tested the patch for SPEC2017 with both -march=cascadelake > -Ofast -flto and -O2 -mtune=generic. > No obvious regression is observed, the binaries are all different from > before, so I looked at 2 of them, the difference mainly comes from > different choices of registers(xmm13 -> xmm12). > Ok for trunk then? OK. Thank you for checking SPEC2017. I hope it will not create troubles for other targets.