From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DC77C433ED for ; Sun, 2 May 2021 05:19:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDE4461353 for ; Sun, 2 May 2021 05:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229909AbhEBFUI (ORCPT ); Sun, 2 May 2021 01:20:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhEBFUH (ORCPT ); Sun, 2 May 2021 01:20:07 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEAA2C06174A for ; Sat, 1 May 2021 22:19:16 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id x7so2131216wrw.10 for ; Sat, 01 May 2021 22:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernelim-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DLerzsoRF0eZbDDedtGe3u3kq/8q/AVf//j55Wc9560=; b=lo4NHWNGd16tL6yNlxynWoC7Nk0W6HYnID2ekCrHJhaXQdUQDCOCIkk68FSrsvbADi /LxFFp9DRmq4n1dOKmuFFFt/EotfxbQkxf5yQUYJxUkWksDR0iMlj6CzKBrKT2G4Dfvb X9nTmx/I/j374d8001bWv6W6cLja9oGOxP35n8NI+CsXRA7dtgHhLGbIKxrOOqjhL9Bh Mzpyiu3rRI1UqToes4U7pyUse44WEEgg1VsgYpksS7aDdwS2KNNVrQRcsg9Te7BgEohT VDFdMH5/maNPL2JaUvHGTjksMdA5kQIhu0vuxYDo06848zIOGNlGdr7ysRtWYLPL9mcQ Yomg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DLerzsoRF0eZbDDedtGe3u3kq/8q/AVf//j55Wc9560=; b=uAVFM3d7IA2m6Ou8GAWZx2kk3cpfb+BOuRnG3AncLJUGTOQxWt8FCymkd3TJN0Bdsx OFRygM0nOWPnyhb3HdXkR3QJAwE8HV1kF+2KKypXNt07BUdsRWFQaKSR4G8x+LsXNvKL HYmYe/Yu8Sn5jbyywLvLSiOJM1g6OIg4dMKBk9Zzc068PkLEmMVViI6HI7jJKzEYQRPY L8aybTwVMocopluL4aFVD/sPS4Czcc+SdvV+WW4EJZ0UKyVgWWD2p5XSkcM509ZlVZpc nyJbTzS4MVwecy14mCnxGOnf+N4TnJTqqZcBHQSofC/U+C+NzDxiCmuANlJ3mB769fNQ nC0A== X-Gm-Message-State: AOAM530J9zhxrHaWuu4sry5DeeEhYcyVUTt1paWaCMXOJrGBew9U/zfe sXrADEy703Ndi/tITZTnCKCYQw== X-Google-Smtp-Source: ABdhPJzOGUfDwp/0tTxSQMlHrq/rsmtGRg8rqELaX8OOekY8A4O3m7rXyrb2UPDgC972LyZUysvejw== X-Received: by 2002:a05:6000:2ae:: with SMTP id l14mr16225032wry.155.1619932755439; Sat, 01 May 2021 22:19:15 -0700 (PDT) Received: from gmail.com ([77.124.118.36]) by smtp.gmail.com with ESMTPSA id u17sm17039897wmq.30.2021.05.01.22.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 22:19:14 -0700 (PDT) Date: Sun, 2 May 2021 08:19:09 +0300 From: Dan Aloni To: Nick Desaulniers Cc: Linus Torvalds , Tom Stellard , Masahiro Yamada , Nathan Chancellor , Linux Kernel Mailing List , clang-built-linux , Fangrui Song , Serge Guelton , Sylvestre Ledru Subject: Re: Very slow clang kernel config .. Message-ID: <20210502051909.pac2pycninc7fl53@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 30, 2021 at 06:48:11PM -0700, Nick Desaulniers wrote: > On Fri, Apr 30, 2021 at 6:22 PM Linus Torvalds > wrote: > > 0.92% libLLVM-12.so llvm::StringMapImpl::LookupBucketFor > > ^ wait a minute; notice how in your profile the `Shared Object` is > attributed to `libLLVM-12.so` while mine is `clang-13`? Clang can be > built as either having libllvm statically linked or dynamically; see > the cmake variables > LLVM_BUILD_LLVM_DYLIB:BOOL > LLVM_LINK_LLVM_DYLIB:BOOL > BUILD_SHARED_LIBS:BOOL > https://llvm.org/docs/CMake.html > > I think those are frowned upon; useful for cutting down on developers > iteration speed due to not having to relink llvm when developing > clang. But shipping that in production? I just checked and it doesn't > look like we do that for AOSP's build of LLVM. There's also `-DLLVM_ENABLE_LTO=Thin` that enables LTO for building LLVM and Clang themselves, considered they can be bootstrapped like this using a previous version of Clang. Combining that with a non-shared library build mode for both Clang and LLVM, the result is possibly the fastest and most optimized build that is achievable. Unfortunately I see distributions neglecting to enable this in packaging this as well. On a side note, I'm also a Fedora user and agree with Linus about this. I'd like to see an opt-in bypass of the shared library policy via something like `dnf install clang-optimized` that would install the fastest and most optimized Clang build regardless of RPM install size. -- Dan Aloni