From owner-freebsd-arch@freebsd.org Sat Jun 2 17:29:30 2018 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBD02FD4E6D for ; Sat, 2 Jun 2018 17:29:30 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-yb0-x242.google.com (mail-yb0-x242.google.com [IPv6:2607:f8b0:4002:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 608756DBE0; Sat, 2 Jun 2018 17:29:30 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-yb0-x242.google.com with SMTP id h141-v6so2571226ybg.4; Sat, 02 Jun 2018 10:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k0x841W2TWVtt5lp1ERxQ16a4SvbTRi4J1YD6mnkKi0=; b=LWsPNmY/j/3pW4XsoC25KqZNiGGRYZTgKmYyNDQpD/HjPoJ/VJJ5mxfGWppDWxZ2dM +Swdn/frx3RC8XLaYWLeWrmQRfsLOjpbBEfw/nEjEGQ2YalrCBnsbglezWjMTfYbir6t 00xBnscuSetPvitew95bVbTRVzHV8brCEVFVDoJ/0o1EIFRL4IdGHFFnHZBXBxE1VmHB RJCrdNiAMBZD1uWlmlmGWsfweJRZt+u1x3Z4dt2kykJjTuSZLhfYlMK83BV8hqUfu1bC hhrpZ8MWADwEj5jYqjHsK7lgfnGxkmJrkceqa//wwlRwkl22J6YvAKR90eGs56HLXaIm y1IA== 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=k0x841W2TWVtt5lp1ERxQ16a4SvbTRi4J1YD6mnkKi0=; b=c5l1cbaibiD2h6RtTArSVLKMEek1qtv6V6DOS/CWQe6BHKZNiuyG693o+RvgpFZ+M3 GoR+omv/hD3oj8rzF+PJ51YKgUsqr1r8q1lZDUUFmVq9MngZK9idHfCVU+refo7ec/N/ UtwrZQCuI+Z151xVzxfE1jfs7SFunfwBJENZPPTaPaIY5bea/bz1ouSgznR46pSQWVuX n5LlIlTyMJpVtX+COsoK7dUBxZHBfablSRC6dLsK0kszl7PidS33426Bmz+u/gpOuFaO cy69OyKE3ffdJ/JaenNgwi3EIDFEN5CH4xL7eV/66IK9VZP/46jUmEPh0v5kL6zItchX 6FRQ== X-Gm-Message-State: ALKqPwfvqyTEpuGu8ddZel7yj97sv3uohGEmVBKtYXqO1nrYSet3acWl pNbP/cD6Nq7x5syAZmF4VQY+tyPJPwyu/SsXYH+QStvh X-Google-Smtp-Source: ADUXVKLvbTPwjDoyjQkHxld/9ZMczCJhenDCjOLedmYomMxTEhXP9lcxC/DpZcjFUMDrArjyM2DMJuhAZEcqGoGhnn4= X-Received: by 2002:a25:44a:: with SMTP id 71-v6mr8585493ybe.463.1527960569447; Sat, 02 Jun 2018 10:29:29 -0700 (PDT) MIME-Version: 1.0 References: <20180601201221.GC29648@spindle.one-eyed-alien.net> <43b75e30-70af-e98d-7d9f-8fccaf3dcbba@freebsd.org> <20180601222914.GE29648@spindle.one-eyed-alien.net> In-Reply-To: <20180601222914.GE29648@spindle.one-eyed-alien.net> From: Alexander Richardson Date: Sat, 2 Jun 2018 18:29:18 +0100 Message-ID: Subject: Re: Building and Iterating To: brooks@freebsd.org Cc: sbruno@freebsd.org, freebsd-arch@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2018 17:29:31 -0000 On Fri, 1 Jun 2018 at 23:29, Brooks Davis wrote: > > On Fri, Jun 01, 2018 at 04:11:06PM -0600, Sean Bruno wrote: > > > > > > On 06/01/18 14:12, Brooks Davis wrote: > > > On Fri, Jun 01, 2018 at 11:20:22AM -0600, Sean Bruno wrote: > > >> 3. If the boostrap toolchain needs to be built in the normal case, only > > >> target the ARCH being requested. I understand that we "want" a CC > > >> installed that targets all architectures and this is something I agree with. > > > > > > The LLVM backends are a tiny part of the LLVM build both in terms > > > of number of files and compile complexity. Removing them would > > > require quite a bit of work (and ongoing maintenance) for a negliable > > > improvement. > > > > Can you educate me on why its so hard to maintain this part of our > > tools? I'm ignorant here and haven't looked to deeply into the abyss > > whereas you have been swimming in the darkness. > > Because upstream makes absolutely no provision for this. In our case we > do maintain the build infrastructure which would help a bit (since we > wouldn't be maintaining diffs to CMakeFiles), but it won't help at all > with the fact that any code can assume that all backends are there and > the constants associated with there are defined. I'm not sure how big > that part is, but we'd certainly have some divergence to maintain. IIRC > the backends are <5% of LLVM compile time. > If you build from the upstream CMakeLists you can set -DLLVM_TARGETS_TO_BUILD=X86 (I believe =host should also work) and then compare that to the time it takes when building with -DLLVM_TARGETS_TO_BUILD=all. I don't think it will save very much time compared to the total build duration since you will still need to build quite a few files from lib/Target (especially for x86). ~/cheri/llvm(master * u=)> find lib/Target -name "*.cpp" | wc -l 723 ~/cheri/llvm(master * u=)> find . -type d -name "test" -prune -o -name "*.cpp" | wc -l 3147 Just based on this it would seem like in the best case you *might* be able to reduce LLVM compile time by < 20%. However, depending on the target you will have to build about 200+ files in lib/Target as well and at least to me it seems like the .cpp in clang take a lot longer to build than in LLVM. My guess is that omitting the cross toolchain could give you maybe 5-10% reduction in LLVM compile time but I haven't measured it. Alex