From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: How do I use `native-comp-compiler-options`? Date: Tue, 05 Sep 2023 06:14:43 -0400 Message-ID: References: <87pm2z5has.fsf@strawberrytea.xyz> <837cp76van.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29877"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: StrawberryTea , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 05 12:15:49 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qdT65-0007as-47 for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Sep 2023 12:15:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdT57-0006nU-6r; Tue, 05 Sep 2023 06:14:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdT54-0006lk-OC for emacs-devel@gnu.org; Tue, 05 Sep 2023 06:14:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdT54-0007EN-EN; Tue, 05 Sep 2023 06:14:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=cq/8josHupTk71p18Ik/zD/kBHFjcDc+H/7lAZJWf4I=; b=L2Rw+qaxJ8UIrTotd6iM NyjB2KGb9fSfaHoUzyiVeQwjge/fjb/8pPoLfKQXSlktGWsOIuI5RhfwYysxSRitjz8E7T5+SSBx6 m0d0rl3tCorbpCv0AmtRiER8IkzICIvTacpCwPbOe5TAbYU6BbI50Ficfig0siFs8fZipXEtwn5f6 RdTW84QwVD6mqu5Hl/nLWefAvXO0IRW5DGmRt0Yz0oAhephL17LfGbcebYtsHtkQ3eNdnYM7IuGZh XA/U6jeVKRuweXvrIhOAtqbFqJ4WvDP/7SddYE+7PvlzUNEi+Xh/nMHi5i+Pl6Kn9Zk63YQ8cz68X 1uG1787H24Zzxg==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qdT52-0004y0-1V; Tue, 05 Sep 2023 06:14:45 -0400 In-Reply-To: <837cp76van.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 03 Sep 2023 20:06:24 +0300") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310119 Archived-At: Eli Zaretskii writes: >> From: StrawberryTea >> Date: Sun, 03 Sep 2023 11:54:03 -0500 >> >> >> Hi. So I'm just wondering how to use `native-comp-compiler-options`. >> Does it just take the same values that CFLAGS can take? I'm asking >> because I patched my Emacs to define `native-comp-compiler-options` as >> >> ``` >> `("-march=skylake" "-Ofast" "-g0" "-fno-finite-math-only" >> "-fomit-frame-pointer" "-malign-data=cacheline" "-fira-region=mixed" >> "-fira-algorithm=CB" "-fira-hoist-pressure" "-fira-loop-pressure" >> "-floop-nest-optimize" "-fgraphite-identity") >> ``` >> >> but I don't really notice any difference in performance in usage nor in >> any of the benchmarks in my config file: >> https://github.com/lemonbreezes/cae-emacs/blob/master/benchmarks/seq-cl-dash-benchmarks.org?plain=1#L9 >> https://github.com/lemonbreezes/cae-emacs/blob/master/benchmarks/silly-loop.el#L3 >> >> Nor do I see a difference when I compile `silly-loop` with and without >> the above options. I am using `native-comp-speed` 3 and lexical binding >> for all files and my GCC version is >> ``` >> gcc (Gentoo 14.0.0 p, commit d0b55776a4e1d2f293db5ba0e4a04aefed055ec4) >> 14.0.0 20230903 (experimental) a7d052b3200c7928d903a0242b8cfd75d131e374 >> ``` >> >> I'm not sure if it's because my benchmarks are too trivial or because I >> have `native-comp-speed` 3 so there is not much to optimize beyond that. >> I definitely do notice the numbers change more when I recompile Emacs >> itself with different CFLAGS and I think I did notice a difference >> bumpin `native-comp-speed` up from 2 to 3 but not from setting >> `native-comp-compiler-options`. > > I think you will be better off asking these questions the libgccjit > developers (they are on the GCC team) -- they know better which of the > GCC Flags affect native-code emitted by native compilation. > > I've added Andrea, in case he has any insights. Yep, it should digest all the CFLAGS that are used by the compiler (not the linker). I'm only unsure if one specifies say -O3 if this takes precedence on what we control with native-comp-speed (GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL), this should be a question for the libgccjit mailing list. Bests Andrea