From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id D65BC3857C69 for ; Sat, 20 Feb 2021 17:31:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D65BC3857C69 Received: by mail-qk1-x72a.google.com with SMTP id f17so8782718qkl.5 for ; Sat, 20 Feb 2021 09:31:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y39wN4kmL7t5LSdgu0BOUF/8ACc9xmg1e9xyka9aSAY=; b=ZqAdydJCKyx1z/X5hlsq75y9IomnvQvCk3v+UDs7VVtSO79CUYZeLdWpH+jVvZvVjE Ls4OhO10DCU/xIyp/+aPYD+alBJ7uppylqXubk5Qjgd6SubkALTabKPusyGEeIj0Nm21 VuiMbUcbTf1mVFtQZhA0IEnVbllERGSHO18G9alcCb/JiDHjV5J0TlXgF06KMRf7T9qr D2KdvfOF1d46PPCCe6PLXKJ+wilOwaFYunZA3QaRz7VJa8pfx6kwUQ50XhX4mgAZLFlM hSxOfGSpo6HOf9HbDOrRYiA7DiDCG3R6FDp2CKD3t4IpqPR4+CSlZM+dsOOS7IXo6hNP 34Wg== X-Gm-Message-State: AOAM533GN1nPpeNVPJXvCHPyBnVYlq0ybQAI9xUlrfkDCknniba53Dzj rFa7KRNvEhgYR6OCl7K6iPY08yInHA3TV7pFq9EzPg== X-Google-Smtp-Source: ABdhPJy32srU6Xi5HktS9FS8i/sGj0JWU86LGCK9IzTB3OKmtDB9HNcteS+cuXLJyWbXz+yHROXPTrE0KNiGHyQMgtg= X-Received: by 2002:a37:48c2:: with SMTP id v185mr14590779qka.329.1613842313515; Sat, 20 Feb 2021 09:31:53 -0800 (PST) MIME-Version: 1.0 References: <7b6a127e.56143.177bd92ecd4.Coremail.ijinma@yeah.net> In-Reply-To: From: Xinliang David Li Date: Sat, 20 Feb 2021 09:31:42 -0800 Message-ID: Subject: =?UTF-8?Q?Re=3A_How_to_successfully_use_autoLIPO_on_GCC=EF=BC=9F?= To: Teresa Johnson Cc: ijinma , "gcc-help@gcc.gnu.org" X-Spam-Status: No, score=-18.3 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, HTML_FONT_FACE_BAD, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2021 17:31:56 -0000 For AutoLIPO to work, there is going to be some build tool changes. The reason is that AutoFDO does not have the training run step and therefore can not produce dynamic callgraph and module grouping directly. In other words, it needs a two pass build -- so build tools need to changed for autoLIPO. We use blaze internally, and it is changed to do the two pass build -- the first pass produces module grouping info which is integrated with the autoFDO profile, and the second pass turns on LIPO mode. You will need to do similar things for whatever build system you are using. Hopefully this is helpful. David On Sat, Feb 20, 2021 at 8:31 AM Teresa Johnson wrote= : > +davidxl who might remember the necessary options. > > It's been a good 3-4 years since we've worked on or used gcc and LIPO, so > my memory is pretty stale on the usage model. I never myself worked on th= e > autoFDO tool, so I don't know the options there. A few comments/responses > below. > > On Fri, Feb 19, 2021 at 7:55 PM ijinma wrote: > >> hi, Johnson >> >> I happened to see your patches( >> https://chromium.googlesource.com/chromiumos/third_party/gcc/+/2eee69423= 94ea46458d4412d613623fac806247d) >> about autoLIPO LIPO in Google GCC. Recently, I was studying autoLIPO( >> autoFDO + lipo), but unfortunately, I encountered some problems, so I >> want to seek your help. Although the llvm thinLTO has a great advantage,= I >> still want to try autoLIPO on GCC. I read the source code of the autoFDO >> tool briefly, but unfortunately I didn't find a way to enable autoLIPO. >> >> I want to recreate autoLIPO work, and I think it's worth continuing >> on gcc. I think there should be a proper way to turn on autoLIPO, though= it >> might be very old. But I'm a beginner in the compiler direction, and I'm >> not good at all of this. >> >> So could you give me some help? >> >> 1. GCC(google gcc_4.8 ?)( >> https://chromium.googlesource.com/chromiumos/third_party/gcc/+/refs/head= s/svn-mirror/google/gcc-4_8) >> and autoFDO(https://github.com/google/autofdo) versions that have been >> successfully run by autoLIPO, or some suggestions. >> > > Whatever is the most recent google gcc branch would support autoFDO. I > believe that google/gcc_4.8 branch is it. Not sure about the autoFDO tool > though, David might know. > >> >> 2. The usage or description of autoFDO enabling auxiliary module. Tha= t >> is, the imports file generated by AutoFDO stores the grouping algorithm >> result of the LIPO module. >> > > I'm not personally familiar with usage of the autoFDO tool, but again, > David might remember. > > >> >> 3. Or what would I need to do if I wanted to successfully use autoLIP= O >> on GCC? >> > > If you want to use it with a more recent gcc I'm afraid that is probably > going to be a lot of work. I remember each time we synced our google bran= ch > with a more recent mainline it required months of work to iron out all of > the LIPO interactions, since that wasn't supported by the main gcc branch= . > > Teresa > > >> Looking forward to your reply! >> >> thanks=EF=BC=8C >> ijinma >> > > > -- > Teresa Johnson | Software Engineer | tejohnson@google.com | >