From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id DEC2B3858D37 for ; Thu, 25 May 2023 13:25:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEC2B3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6af7593ed5fso608366a34.0 for ; Thu, 25 May 2023 06:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1685021136; x=1687613136; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:errors-to:references:organization:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=2xvejzzSihIHeDJN7jkTW9OAbaoTsFza1D/nSw2LLTg=; b=IrmvyXT6tJAsdUvn9qbZynMBdX7fs62A7DWMs9GrQT59JwcpdrzonStWJUyTLREoU9 7TbdkfaeExwE8+MAvx8CvUcPNh3WBeuU9XGQCfW7SZ0aUP7n6ykPzIk+u8L5DVZ95aty Sk58PEJtr/mG4SXAwxj47yEV/nqmRTz79NdHRAf8rwwWHH+IncxSAU6t4vzkp2EK7BET BtYqTy+dT+Zl9PxEAufNEoS6G0NGogBCzoicnW/P/xjzd57U11svC6r0J+ktabCIODVc fMiNPwRsiE1idmWPE5zLikZ4U3OWF7Y+8/MgmR4/MgqOvBcG7FEQq/JS+4WU2bUrB3Lc MEkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685021136; x=1687613136; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:errors-to:references:organization:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2xvejzzSihIHeDJN7jkTW9OAbaoTsFza1D/nSw2LLTg=; b=biafUhuIvzUGVqnkCfDpKMQecBFSS0qRJ53LNwQsDEH8ZnZWSVAK2yJtGQbGUJLaHF BHkO9IFotdFsubDgkRbGJz1EqygfuZF+xMMgiwV3k47ABRVO1pnJzTfDkiMTw5h2mgHQ H1IEddGvE9D/NuNBAC9hj/Y7UAHAevIZ9vuh0ZprOg5m38VWQ28P9dpyLb09vo6MG20o CRpc3UkUnJG5jFXVVlaoaWtOIVmvQQUu8WtEM22rqYx8orxhtSzwy9p2vfvIcDGII8I/ wf2Or17B+S7T1BfFHFfO2tZI7HUgV7tCEq7uno55LAh1diTuPB+/EkZQ0KeUKB1NRYPk Miow== X-Gm-Message-State: AC+VfDzmq4CFBzKwFNOaeVAt0+GHHstjgfU0uU5GZ9TvMDKusXAjb16s Ym/zoxdskN2Ubjxvuba0JAjsIQ== X-Google-Smtp-Source: ACHHUZ5E/oPQ4agSU9yGcG28gAmyDVW1aaxw/RkLJDA8/g3jiVow9WCDx9dWcMLMWH0+jlTsgdZVCw== X-Received: by 2002:a05:6808:6d0:b0:398:4385:baf4 with SMTP id m16-20020a05680806d000b003984385baf4mr3791039oih.49.1685021136122; Thu, 25 May 2023 06:25:36 -0700 (PDT) Received: from free.home ([2804:7f1:2080:6383:46d9:ede8:ee97:8cc0]) by smtp.gmail.com with ESMTPSA id k22-20020a9d7dd6000000b006ab04994a1csm595818otn.65.2023.05.25.06.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 06:25:35 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 34PDPLXW3679753 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 25 May 2023 10:25:22 -0300 From: Alexandre Oliva To: Richard Biener Cc: gcc-patches@gcc.gnu.org, "H.J. Lu" , Jan Hubicka , Uros Bizjak Subject: Re: [PATCH] [x86] reenable dword MOVE_MAX for better memmove inlining Organization: Free thinker, does not speak for AdaCore References: Errors-To: aoliva@lxoliva.fsfla.org Date: Thu, 25 May 2023 10:25:20 -0300 In-Reply-To: (Richard Biener's message of "Thu, 25 May 2023 13:33:40 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On May 25, 2023, Richard Biener wrote: > On Thu, May 25, 2023 at 1:10=E2=80=AFPM Alexandre Oliva wrote: >>=20 >> On May 25, 2023, Richard Biener wrote: >>=20 >> > I mean we could do what RTL expansion would do later and do >> > by-pieces, thus emit multiple loads/stores but not n loads and then >> > n stores but interleaved. >>=20 >> That wouldn't help e.g. gcc.dg/memcpy-6.c's fold_move_8, because >> MOVE_MAX and MOVE_MAX_PIECES currently limits inline expansion to 4 >> bytes on x86 without SSE, both in gimple and RTL, and interleaved loads >> and stores wouldn't help with memmove. We can't fix that by changing >> code that uses MOVE_MAX and/or MOVE_MAX_PIECES, when these limits are >> set too low. > Btw, there was a short period where the MOVE_MAX limit was restricted > but that had fallout and we've reverted since then. Erhm... Are we even talking about the same issue? i386/i386.h reduced the 32-bit non-SSE MOVE_MAX from 16 to 4, which broke this test; I'm proposing to bounce it back up to 8, so that we get a little more memmove inlining, enough for tests that expect that much to pass. You may be focusing on the gimple-fold bit, because I mentioned it, but even the rtl expander is failing to expand the memmove because of the setting, as evidenced by the test's failure in the scan for memmove in the final dump. That MOVE_MAX change was a significant regression in codegen for 32-bit non-SSE x86, and I'm proposing to fix that. Compensating for that regression elsewhere doesn't seem desirable to me: MOVE_MAX can be much higher even on other x86 variants, so the effects of such attempts may harm quite significantly more modern CPUs. Conversely, I don't expect the reduction of MOVE_MAX on SSE-less x86 a couple of years ago to have been measured for performance effects, given the little overall relevance of such CPUs, and the very visible and undesirable effects on codegen that change brought onto them. And yet, I'm being very conservative in the proposed reversion, because benchmarking such targets in any meaningful way would be somewhat challenging for myself as well. So, could we please have this narrow fix of this limited regression at the spot where it was introduced accepted, rather than debating tangents? --=20 Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about