[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shrinking the C core
From: |
Eli Zaretskii |
Subject: |
Re: Shrinking the C core |
Date: |
Sun, 20 Aug 2023 22:07:50 +0300 |
> From: "Alfred M. Szmidt" <ams@gnu.org>
> Cc: eliz@gnu.org, incal@dataswamp.org, emacs-devel@gnu.org
> Date: Sun, 20 Aug 2023 14:54:46 -0400
>
>
> "Alfred M. Szmidt" <ams@gnu.org> writes:
>
> > Not really. Native compilation already uses GCC. At least on the byte
> > code instructions and, separately, in subr code.
> > There is more than just GCC vs byte code VM in it.
> >
> > It is not about native compilation! It is about what OPTIMIZATIONS
> > can be done to the actual code flow. Just using GCC doesn't do ANY
> > optimizations to how the Lisp code is optimized or how its flow is
> > changed due to optimizations!
>
> Then, what does GCC do? AFAIK, GCC JIT takes the Elisp byte code,
> transforms it into JIT pseudocode, and optimizes the actual code flow.
>
> What does GCC do _WHERE_? What backend? What language? You're
> speaking in such broad terms that it makes it impossible to continue
> this discussion. I don't know how the native compilation works, but
> no matter what you feed to GCC it cannot do magic and any optimization
> should be done on what the Emacs compiler does.
>
> For example, when I write
>
> (when (> x y) (when (> x y) x))
>
> I expect GCC JIT to throw away the duplicate comparison.
>
> Why do you expect that? Why do you think it is duplicate? Where are
> the guarantees that > or WHEN don't have side-effects?
Andrea will correct me if I'm wrong, but AFAIU Ihor is correct: native
compilation in Emacs emits a kind of GIMPLE, which is then subject to
GCC optimization pass. That's why we have the native-comp-speed
variable, which is mapped directly into the GCC's -On optimization
switches, with n = 0..3.
Maybe the SBCL compiler has better optimizations, but it is incorrect
to say that Emacs's native-compilation has none.
- Re: Shrinking the C core, (continued)
- Re: Shrinking the C core, Emanuel Berg, 2023/08/20
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Eli Zaretskii, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Alfred M. Szmidt, 2023/08/20
- Re: Shrinking the C core,
Eli Zaretskii <=
- Re: Shrinking the C core, Emanuel Berg, 2023/08/27
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/20
- Re: Shrinking the C core, Eli Zaretskii, 2023/08/20
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/21
- Re: Shrinking the C core, Po Lu, 2023/08/21
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/21
- Re: Shrinking the C core, Po Lu, 2023/08/21
- Re: Shrinking the C core, Ihor Radchenko, 2023/08/21
- RE: [External] : Re: Shrinking the C core, Drew Adams, 2023/08/21