emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42147: closed (28.0.50; pure vs side-effect-free, missing optimizati


From: GNU bug Tracking System
Subject: bug#42147: closed (28.0.50; pure vs side-effect-free, missing optimizations?)
Date: Tue, 07 Jul 2020 15:56:01 +0000

Your message dated Tue, 7 Jul 2020 17:54:56 +0200
with message-id <F368819C-EE60-4172-B2F0-95560C406AED@acm.org>
and subject line Re: bug#42147: 28.0.50; pure vs side-effect-free, missing 
optimizations?
has caused the debbugs.gnu.org bug report #42147,
regarding 28.0.50; pure vs side-effect-free, missing optimizations?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
42147: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=42147
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 28.0.50; pure vs side-effect-free, missing optimizations? Date: Tue, 30 Jun 2020 22:27:12 +0000 (UTC)
Hi all,

I was looking in byte-opt.el to how are classified a number of
functions.

My understanding is that pure functions should be technically a subset
of side-effect-and-error-free for which the environment has no influence
on the value the function evaluates to.  For this reason they can be
constant folded in the compile time if possible.

Now in pure functions I see we do not have a lot of functions that (to
my understanding) would classify for that.  I'm thinking to simple
predicates acting on immutable objects as consp or fixnump to give an
example.

Shouldn't we move these into the pure class?

ATM for instance this does not get optimized:

(defun foo ()
  (fixnump 3))

In case this makes sense I'll be happy to work on it and prepare a
patch.

Thanks

  Andrea




--- End Message ---
--- Begin Message --- Subject: Re: bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations? Date: Tue, 7 Jul 2020 17:54:56 +0200
6 juli 2020 kl. 23.23 skrev Andrea Corallo <andrea_corallo@yahoo.it>:

> Yes I am happy :) Not sure about the floating point discussion
> originated from this but on my side this bug can be closed.

Then closed it is. I would happily write something in NEWS but -- as Eli noted 
-- for any noticeable change in behaviour to occur, many conditions need to be 
met, several of which are quite unlikely.

More improvements to the constant-folding are possible and desirable. For 
example, I have a patch that deals with constant expressions in let-bindings, 
so that

(let ((x (+ 1 2)))
  (f x))

simplifies to (f 3), with the variable x removed. This in turn generates more 
opportunities for further simplification and dead-code elimination. Tell me if 
you are interested.



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]