all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo <acorallo@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: StrawberryTea <look@strawberrytea.xyz>,  emacs-devel@gnu.org
Subject: Re: How do I use `native-comp-compiler-options`?
Date: Tue, 05 Sep 2023 06:14:43 -0400	[thread overview]
Message-ID: <yp18r9l2agc.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <837cp76van.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 03 Sep 2023 20:06:24 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: StrawberryTea <look@strawberrytea.xyz>
>> 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



  reply	other threads:[~2023-09-05 10:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-03 16:54 How do I use `native-comp-compiler-options`? StrawberryTea
2023-09-03 17:06 ` Eli Zaretskii
2023-09-05 10:14   ` Andrea Corallo [this message]
2023-09-04  0:23 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yp18r9l2agc.fsf@fencepost.gnu.org \
    --to=acorallo@gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=look@strawberrytea.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.