comp: Make use of predicates in propagation for non builtin types
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-ctxt): Add `pred-type-h' slot. * lisp/emacs-lisp/comp.el (comp-known-predicate-p) (comp-pred-to-cstr): Update.
This commit is contained in:
parent
f4de81af8f
commit
d03dd07774
2 changed files with 13 additions and 2 deletions
|
@ -641,11 +641,14 @@ Useful to hook into pass checkers.")
|
|||
|
||||
(defun comp-known-predicate-p (predicate)
|
||||
"Return t if PREDICATE is known."
|
||||
(when (gethash predicate comp-known-predicates-h) t))
|
||||
(when (or (gethash predicate comp-known-predicates-h)
|
||||
(gethash predicate (comp-cstr-ctxt-pred-type-h comp-ctxt)))
|
||||
t))
|
||||
|
||||
(defun comp-pred-to-cstr (predicate)
|
||||
"Given PREDICATE, return the corresponding constraint."
|
||||
(gethash predicate comp-known-predicates-h))
|
||||
(or (gethash predicate comp-known-predicates-h)
|
||||
(gethash predicate (comp-cstr-ctxt-pred-type-h comp-ctxt))))
|
||||
|
||||
(defconst comp-symbol-values-optimizable '(most-positive-fixnum
|
||||
most-negative-fixnum)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue