From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 848983853543 for ; Thu, 6 Oct 2022 08:29:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 848983853543 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x629.google.com with SMTP id o21so2841191ejm.11 for ; Thu, 06 Oct 2022 01:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=j+JraxlAzz+DGVLBRR/G0pExRdW9yPwN+2sQXHQSYBo=; b=bnSkag2YX/rHEshlvgOG+3Y9L3wmTBxJxoAroXo9RPJQpdgCzRIqSL6URd2DTjiJ50 yJaNCUSAjNRQKdrN4gvVOR8qTtjsTlL2qsMeM/THVTMF/L3EXVIHEWlZsYB9twvB80r4 6/mwTnYOdcp3+uzlPaEFNo8t0lZIGJ7mYo58hqGsaHhDShFxzBCiay3oK8XfR7tbDm33 kDhnZwODqGjhC/FaLK0x79kVv0jwwPp1g1Hzi9MuVwPYznXVd99qEAsswZJeRso5uAiP H8Qv1QX4c6ln/lkmyJsZWJQMJvdnUVjnHw3CMmt5RshsaPRdcq7yObKBv0RYpwxXuoBn F0Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=j+JraxlAzz+DGVLBRR/G0pExRdW9yPwN+2sQXHQSYBo=; b=0LUHdeR0Vrv0E9ht8zOeFE5EM7GuGl2womvHnUVLfke/JUxWbphHzSEaO4E40ubxKo LW6db+tkECbBBM+PL58tQjvKB+CRDS2txmirdvmyp1qCsOiYo7HURxg6HZNOnIKDK83j WaYDr45XL+yrZhfzcVObjaEfpE3G9C6EimFMxT7q4mRCtqvG5NSpcnqvploqSrFey2ga 03eUHAgPDxfHeYqbsE5+tMy3MJ895I++GSwuafePx5M879aLLFKVAqUOQtLT0PmovnuU yJn9Y83EWumNUUkIj/gS91koOqxQDl55EelMOkxNru6Zyj8pE1WfBSaVQwqwsiHqTv7c j4Bg== X-Gm-Message-State: ACrzQf30rYOvOrZ2BHa0nE25WL1YQuCkg8IMtoyaZ9KLOyOBZ53pEYbH OqWmJoeEO/qEAhdA+XbEfCggMqg3KR+nzbP4xDw= X-Google-Smtp-Source: AMsMyM5/fx6BfV6DnN/dMlE7QqemH67dBfhF/dBfSJYY8T5BY790ZYTuDbyCQAJP18Np/dz3ILGgr9GuwTH1MYOTmXw= X-Received: by 2002:a17:907:968f:b0:782:6a9d:33fb with SMTP id hd15-20020a170907968f00b007826a9d33fbmr3027559ejc.754.1665044979336; Thu, 06 Oct 2022 01:29:39 -0700 (PDT) MIME-Version: 1.0 References: <137fde8c-7ade-ecc0-96f2-9ec828b4745e@suse.cz> In-Reply-To: From: Richard Biener Date: Thu, 6 Oct 2022 10:29:25 +0200 Message-ID: Subject: Re: [PATCH] IPA: support -flto + -flive-patching=inline-clone To: Qing Zhao Cc: =?UTF-8?Q?Martin_Li=C5=A1ka?= , "gcc-patches@gcc.gnu.org" , Jan Hubicka Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Oct 5, 2022 at 8:18 PM Qing Zhao via Gcc-patches wrote: > > > > > On Oct 5, 2022, at 1:36 PM, Martin Li=C5=A1ka wrote: > > > > On 10/5/22 16:50, Qing Zhao wrote: > >> I have two questions on this: > > > > Hello. > > > >> > >> 1. What=E2=80=99s the motivation to enable -flive-patching with -flto= ? Is there any application that will try -flive-patching with -flto now? > > > > We're planning supporting GCC LTO Linux kernel support, so that's one m= otivation. And the second one is a possible > > use in user-space livepatching. Note majority of modern distros default= to -flto (openSUSE, Fedora, Debian, Ubuntu, ...). > > Okay, I see. That=E2=80=99s reasonable. > > > >> > >> 2. Why only enable -flive-patching=3Dinline-clone with -flto? > > > > Because the inline-only-static level (which you added/requested) would = have to properly > > block inter-procedural inlining that happens in LTO (can_inline_edge_by= _limits_p) and > > I'm not sure it would be properly blocked. So, feel free to extend my p= atch if you want? > > -flive-patching=3Dinline-only-static > > Only enable static functions inlining, all the inlining of external visi= ble functions are blocked, So, LTO should be compatible with this naturally= without any issue, I think. > > i.e, when "-flive-patching=3Dinline-only-static -flto" present together,= all the inter-procedural inlining should be automatically blocked by -fliv= e-patching=3Dinline-only-static already. > > Do I miss anything here? WPA will promote externally visible functions static when all accesses are from LTO IR, I don't think we preserve the "original" visibility for IPA inlining heuristics. OTOH inline-only-static could disable WPA inlining and do all inlining earl= y ... Richard, > > thanks. > > Qing > > > > > Martin > > > >> > >> thanks. > > >