summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-06-07 11:46:08 +0200
committerAndrea Corallo <akrl@sdf.org>2020-06-07 16:59:23 +0200
commit47a6fbd38278b40737d498a41a35259458633136 (patch)
tree0475908975d792f6742b4ae7e3bc093b719cb7a2 /lisp/emacs-lisp/comp.el
parenta58fef9f63fd4383c4eae9dfe8ae663b4ed710d1 (diff)
downloademacs-47a6fbd38278b40737d498a41a35259458633136.tar.gz
emacs-47a6fbd38278b40737d498a41a35259458633136.tar.bz2
emacs-47a6fbd38278b40737d498a41a35259458633136.zip
* Improve propagate pass
As function folding can generate 'setimm' insns handle them in the `comp-propagate-insn'. * lisp/emacs-lisp/comp.el (comp-propagate-insn): Handle 'setimm' insn.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 4926c5d683f..ecd411591a3 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1926,6 +1926,10 @@ Here goes everything that can be done not iteratively (read once).
(comp-function-call-maybe-remove insn f args)))
(_
(comp-mvar-propagate lval rval))))
+ (`(setimm ,lval ,v)
+ (setf (comp-mvar-const-vld lval) t
+ (comp-mvar-constant lval) v
+ (comp-mvar-type lval) (comp-strict-type-of v)))
(`(phi ,lval . ,rest)
;; Forward const prop here.
(when-let* ((vld (cl-every #'comp-mvar-const-vld rest))