From patchwork Thu Aug 20 22:00:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Belinassi X-Patchwork-Id: 1348638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=fBJBHpbq; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BXdrM5Vzpz9sPB for ; Fri, 21 Aug 2020 08:00:51 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1EAF1386EC6E; Thu, 20 Aug 2020 22:00:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EAF1386EC6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597960843; bh=nFATVFDo50BIEHVc7g7uAUmAqehMUGgs2RULYL1YqwY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=fBJBHpbqYT2yGEJIAISyO2clqXCRouXjlm/rX9M6YpiBZv1KeGDFTyaVBRe0zGBT3 jtwoYnpd9WFB/tfgcGzoi8DiFyKRbnMcgGqoN/m4fbxQFBV+Rm9leaPLBUUAMCORfI gHTfw40C0uVrn9hHLShHh3LQV8gaNFrEsN5a9Akg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by sourceware.org (Postfix) with ESMTPS id 3C39D3857C4D for ; Thu, 20 Aug 2020 22:00:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3C39D3857C4D Received: by mail-qk1-x732.google.com with SMTP id m7so2902868qki.12 for ; Thu, 20 Aug 2020 15:00:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nFATVFDo50BIEHVc7g7uAUmAqehMUGgs2RULYL1YqwY=; b=m6o6U5x1ry0DxLvJWwGFZcz3DHbuda9K9ehyezGIvhbuJ22imGX0j5rQX/Nv6Lnzrj nJlCd26e4pqQgMnq0GXsNOQJcK8AuuEALKRYl5eRnGmd9nrK4erZKE+lhs6r/SSSp47w 7gLx4fn+ApgInaQOpOw4Li2W10znpoot/3YrWJ4qHcOb9JB8HqMk37vU2afI29uW63// wFzTMxUYP2tjT2Yzjb555drXuFNMyBgXLDakCDnJQELQiP8QnDxbYLgZs72VDX3Efnyk FhDwiUu2oJc1bQzV2r+aV6uBafnQqlLls1wibwcOj+cpwMLM7elulZ8sLljy1fiuMTy2 VIdw== X-Gm-Message-State: AOAM5305czxd3muhBwwCicGjKjxtuxqIhT4jFMcJis6Foqs4YLohEnZz fscDMskOHPerIRtYA1N+/44jVCIgTSrXRQ== X-Google-Smtp-Source: ABdhPJycXGa2tvRyIPvMRtG7iMswoKsjoalTIbsjmwhkt9BiEwVWdPY9mXwcXsKZMpfUxFJQuFLeag== X-Received: by 2002:ae9:e641:: with SMTP id x1mr48731qkl.424.1597960839400; Thu, 20 Aug 2020 15:00:39 -0700 (PDT) Received: from localhost.localdomain ([186.207.74.113]) by smtp.gmail.com with ESMTPSA id m66sm3302500qkf.86.2020.08.20.15.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 15:00:38 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 5/6] Add invoke documentation Date: Thu, 20 Aug 2020 19:00:18 -0300 Message-Id: <20200820220019.3131804-6-giuliano.belinassi@usp.br> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820220019.3131804-1-giuliano.belinassi@usp.br> References: <20200820220019.3131804-1-giuliano.belinassi@usp.br> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Giuliano Belinassi via Gcc-patches From: Giuliano Belinassi Reply-To: Giuliano Belinassi Cc: hubicka@ucw.cz Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Add documentation about how to invoke GCC in order to use parallel compilation. gcc/ChangeLog: 20-08-2020 Giuliano Belinassi * doc/invoke.texi: Document -fparallel-jobs=. --- gcc/doc/invoke.texi | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 70dc1ab73a1..18cebf99dfd 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -504,7 +504,8 @@ Objective-C and Objective-C++ Dialects}. -fno-sched-spec -fno-signed-zeros @gol -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol -fomit-frame-pointer -foptimize-sibling-calls @gol --fpartial-inlining -fpeel-loops -fpredictive-commoning @gol +-fpartial-inlining -fparallel-jobs=@var{alg} @gol +-fpeel-loops -fpredictive-commoning @gol -fprefetch-loop-arrays @gol -fprofile-correction @gol -fprofile-use -fprofile-use=@var{path} -fprofile-partial-training @gol @@ -14511,6 +14512,35 @@ of the function name, it is considered to be a match. For C99 and C++ extended identifiers, the function name must be given in UTF-8, not using universal character names. +@item -fparallel-jobs=@var{n} +@opindex parallel +This option is experimental. + +This option enables parallel compilation of files using a maximum of +@var{n} parallel jobs. When invoked, it tries to distribute the symbols +within the file into multiple partitions and compile them in parallel. + +For now, private symbols are paritioned together with public symbols +if there are references to them to avoid code layout modifications +when compiling. This means that compiling a file +with very few public symbols will not provide noticeable improvements +in compilation time. However, you can use +@option{--param=promote-statics=1} to allow GCC to automatically +promote a symbol to be globally available, improving compilation +performance in exchange to changing code layout. + +You can also specify @option{-fparallel-jobs=jobserver} to use GNU make's +job server mode to determine the number of parallel jobs. This +is useful when the Makefile calling GCC is already executing in parallel. +You must prepend a @samp{+} to the command recipe in the parent Makefile +for this to work. This option likely only works if @env{MAKE} is +GNU make. If you specify @option{-fparallel-jobs=auto}, GCC will try to +automatically detect a running GNU make's job server. + +An extra parameter, @option{--param=balance-partitions=0} can be used to +avoid balancing created partitions. This should only be used to debug +the compiler. + @item -fpatchable-function-entry=@var{N}[,@var{M}] @opindex fpatchable-function-entry Generate @var{N} NOPs right at the beginning