From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How do I use `native-comp-compiler-options`? Date: Sun, 03 Sep 2023 20:06:24 +0300 Message-ID: <837cp76van.fsf@gnu.org> References: <87pm2z5has.fsf@strawberrytea.xyz> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11695"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: StrawberryTea , Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 03 19:07:13 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 1qcqZ6-0002pU-ES for ged-emacs-devel@m.gmane-mx.org; Sun, 03 Sep 2023 19:07:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcqYg-0002y4-P2; Sun, 03 Sep 2023 13:06:46 -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 1qcqYf-0002wH-0o for emacs-devel@gnu.org; Sun, 03 Sep 2023 13:06:45 -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 1qcqYe-0007XR-Nd; Sun, 03 Sep 2023 13:06:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vh8bI+HWQPotCwDEH6NqVvTcPqH2sQWuaJGiDtJNCB0=; b=pRpV5cUKRFWF mCFCX6Oz6tGqHEjBodVGN3d8pA3SPftcT2M2ngKYd0ESaU1i6QIEHkYXOGZGFYv4hDvFbcZvwlOJK SBwbXzCBUJjAy0uoKU0mu/7cb+kfZ0DS5sKTHNV8clCjue5ccVlStMekOXL3cxpD7vZ1CW2zHqsxJ P1r7WWM/Cu7XlzCznVn8A5qHqep/2bQBOPj4DDCPwyg33xVmZEw6g5qA2TC8nS4N+rLMyrI0QQXis 68UPoh2CGigyYSUKEUFk/WdbmeEP2wJ1YXjXykAQpjBiXKzNd7kjo1d0iUqgnQ0b86geJxQgX+bXX 8FyPgnGMZj0rBXEd9n3LyA==; In-Reply-To: <87pm2z5has.fsf@strawberrytea.xyz> (message from StrawberryTea on Sun, 03 Sep 2023 11:54:03 -0500) 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:310010 Archived-At: > 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.