]> git.eshelyaron.com Git - emacs.git/commit
Enable integer range narrowing under compare and branch
authorAndrea Corallo <akrl@sdf.org>
Fri, 25 Dec 2020 09:57:02 +0000 (10:57 +0100)
committerAndrea Corallo <akrl@sdf.org>
Sat, 26 Dec 2020 09:53:54 +0000 (10:53 +0100)
commit89d5a3a7603a0b096d02f58ba0a1997ad98c63ae
treef7c3cbb76ab35843db9610d536a87e7acaca9733
parentbd693ccea7ba4a6aafda103f7a9166f76363c86b
Enable integer range narrowing under compare and branch

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-cmp-range)
(comp-cstr->, comp-cstr->=, comp-cstr-<, comp-cstr-<=): New
functions.
* lisp/emacs-lisp/comp.el (comp-equality-fun-p)
(comp-range-cmp-fun-p): New functions.
(comp-collect-rhs): Use `comp-assign-op-p' in place of
`comp-set-op-p'.
(comp-negate-range-cmp-fun, comp-reverse-cmp-fun): New functions.
(comp-emit-assume): Rework to be able to emit also comparision
assumption.
(comp-add-cond-cstrs-simple): Update for new `comp-emit-assume'.
(comp-add-cond-cstrs-simple): Update to emit range assumption.
(comp-fwprop-insn): Execute range assumptions.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add tests.
lisp/emacs-lisp/comp-cstr.el
lisp/emacs-lisp/comp.el
test/src/comp-tests.el