[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp e0f20da 14/19: Simplify correctly (or (integer 1 1)
From: |
Andrea Corallo |
Subject: |
feature/native-comp e0f20da 14/19: Simplify correctly (or (integer 1 1) (not (integer 1 1))) as t |
Date: |
Mon, 21 Dec 2020 14:52:41 -0500 (EST) |
branch: feature/native-comp
commit e0f20da6ecd1fceabdce480dd878be293cfba027
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
Simplify correctly (or (integer 1 1) (not (integer 1 1))) as t
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Logic
update.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.
---
lisp/emacs-lisp/comp-cstr.el | 17 +++++++++++------
test/lisp/emacs-lisp/comp-cstr-tests.el | 4 +++-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index a172203..22d3958 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -474,12 +474,17 @@ DST is returned."
(cl-nset-difference (valset neg) (valset pos)))))
;; Range propagation
- (setf (range neg)
- (when range
- (comp-range-negation
- (comp-range-union
- (comp-range-negation (range neg))
- (range pos)))))
+ (when range
+ ;; Handle apart (or (integer 1 1) (not (integer 1 1)))
+ ;; like cases.
+ (if (and (range pos) (range neg)
+ (equal (range pos) (range neg)))
+ (give-up)
+ (setf (range neg)
+ (comp-range-negation
+ (comp-range-union
+ (comp-range-negation (range neg))
+ (range pos))))))
(if (comp-cstr-empty-p neg)
(setf (typeset dst) (typeset pos)
diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el
b/test/lisp/emacs-lisp/comp-cstr-tests.el
index f7ea00e..b38573c 100644
--- a/test/lisp/emacs-lisp/comp-cstr-tests.el
+++ b/test/lisp/emacs-lisp/comp-cstr-tests.el
@@ -199,7 +199,9 @@
;; 80
((and (or marker number) (integer 0 0)) . (integer 0 0))
;; 81
- ((and t (not t)) . nil))
+ ((and t (not t)) . nil)
+ ;; 82
+ ((or (integer 1 1) (not (integer 1 1))) . t))
"Alist type specifier -> expected type specifier.")
(defmacro comp-cstr-synthesize-tests ()
- feature/native-comp updated (5b10a03 -> 9676e4d), Andrea Corallo, 2020/12/21
- feature/native-comp 2a117ad 01/19: * Add mvar pretty print support when dumping LIMPLE, Andrea Corallo, 2020/12/21
- feature/native-comp bad18f5 02/19: * Improve comp-fwprop pass, Andrea Corallo, 2020/12/21
- feature/native-comp a0c0daf 03/19: * Fix a number of type specifier simplification tests, Andrea Corallo, 2020/12/21
- feature/native-comp 34c1d75 05/19: * Enumerate and split type specifier tests in comp-tests.el to ease debug, Andrea Corallo, 2020/12/21
- feature/native-comp 7074988 06/19: * Add a type specifier test to comp-cstr-tests.el, Andrea Corallo, 2020/12/21
- feature/native-comp 0255108 08/19: * Rename comp-cond-cstr into comp-add-cstrs, Andrea Corallo, 2020/12/21
- feature/native-comp 48d43f5 04/19: * Improve constraint simplification logic in comp-cstr.el, Andrea Corallo, 2020/12/21
- feature/native-comp 07b75de 10/19: Enhance type inference constraining function arguments, Andrea Corallo, 2020/12/21
- feature/native-comp e0f20da 14/19: Simplify correctly (or (integer 1 1) (not (integer 1 1))) as t,
Andrea Corallo <=
- feature/native-comp 6f3570c 16/19: Fix value type inference for doubly negate constraints, Andrea Corallo, 2020/12/21
- feature/native-comp d072ee9 07/19: * Two minors in comp.el, Andrea Corallo, 2020/12/21
- feature/native-comp 23791cf 09/19: * Allow for modifying insn-cell inside `comp-loop-insn-in-block', Andrea Corallo, 2020/12/21
- feature/native-comp 9bbe6ea 15/19: Fix native compiler tests when they are bytecompiled, Andrea Corallo, 2020/12/21
- feature/native-comp 8e816b0 11/19: Symplify type specifier (not t) as nil, Andrea Corallo, 2020/12/21
- feature/native-comp c70c080 12/19: * Allow for overlapping src and dst in cstr set operations, Andrea Corallo, 2020/12/21
- feature/native-comp 5376563 17/19: Fix `comp-add-call-cstr' and add a test, Andrea Corallo, 2020/12/21
- feature/native-comp ebf8963 18/19: * Fix a bunch of known type specifiers, Andrea Corallo, 2020/12/21
- feature/native-comp 9676e4d 19/19: * Fix a test in auth-source-tests.el, Andrea Corallo, 2020/12/21
- feature/native-comp 3540b1f 13/19: * Guarantee fwprop convergence and termination, Andrea Corallo, 2020/12/21