emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 2593bbe: * Relax constant folding rules


From: Andrea Corallo
Subject: feature/native-comp 2593bbe: * Relax constant folding rules
Date: Sat, 4 Jul 2020 11:58:07 -0400 (EDT)

branch: feature/native-comp
commit 2593bbee51f4d15d3a4fc1d4e2e3b215222f783a
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Relax constant folding rules
    
    * lisp/emacs-lisp/comp.el (comp-function-optimizable-p): No need to
    check for operands or result to be fixnums.
---
 lisp/emacs-lisp/comp.el | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 8161239..da567fd 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1994,13 +1994,8 @@ Here goes everything that can be done not iteratively 
(read once).
         (memq (get f 'byte-optimizer) comp-propagate-classes)
         (let ((values (mapcar #'comp-mvar-constant args)))
           (pcase f
-            ;; Simple integer operation.
-            ;; Note: byte-opt uses `byte-opt--portable-numberp'
-            ;; instead of just`fixnump'.
-            ((or '+ '- '* '1+ '-1) (and (cl-every #'fixnump values)
-                                        (fixnump (apply f values))))
-            ('/ (and (cl-every #'fixnump values)
-                     (not (= (car (last values)) 0)))))))))
+            ((or '+ '- '* '1+ '-1) t)
+            ('/ (not (= (car (last values)) 0))))))))
 
 (defsubst comp-function-call-maybe-remove (insn f args)
   "Given INSN when F is pure if all ARGS are known remove the function call."



reply via email to

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