master: More constant tracking for destructive modification detection

stassats via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  c3389405764a66412dc4bad86d133fb520bdddd8 (commit)
      from  8a66d3575bf80fd83e337231b4ce85a53765f07d (commit)

- Log -----------------------------------------------------------------
commit c3389405764a66412dc4bad86d133fb520bdddd8
Author: Stas Boukarev <[email protected]>
Date:   Sun Aug 30 04:00:50 2026 +0300

    More constant tracking for destructive modification detection
---
 src/compiler/seqtran.lisp | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/compiler/seqtran.lisp b/src/compiler/seqtran.lisp
index 77de1550e..3e1c462bb 100644
--- a/src/compiler/seqtran.lisp
+++ b/src/compiler/seqtran.lisp
@@ -4511,23 +4511,25 @@
     (make-numeric-type 'integer min max)))
 
 (defoptimizers constants
-    (hairy-data-vector-ref hairy-data-vector-ref/check-bounds
+    (nth nthcdr sb-impl::append2 nreconc revappend
+     %adjoin %adjoin-eq %adjoin-key %adjoin-test %adjoin-key-eq %adjoin-key-test %adjoin-key-test-not
+     %assoc %assoc-eq %assoc-key %assoc-test %assoc-key-eq %assoc-key-test %assoc-key-test-not
+     %rassoc %rassoc-eq %rassoc-key %rassoc-test %rassoc-key-eq %rassoc-key-test %rassoc-key-test-not
+     %member %member-eq %member-key %member-test %member-key-eq %member-key-test %member-key-test-not
+     %find-position %find-position-if %find-position-if-not
+     remove remove-if remove-if-not)
+    ((a b &rest args))
+  b)
+
+(defoptimizers constants
+    (car cdr last elt-list
+     hairy-data-vector-ref hairy-data-vector-ref/check-bounds
      data-vector-ref data-vector-ref-with-offset)
-    ((array index &optional offset))
-  array)
+    ((a &rest args))
+  a)
 
-(defoptimizers constants (nth nthcdr) ((index list))
-  list)
-(defoptimizers constants (car cdr) ((cons))
-  cons)
-
-(defoptimizers constants (%find-position %find-position-if %find-position-if-not)
-    ((x sequence from-end start end key))
-  sequence)
-
-(defoptimizers constants (remove remove-if remove-if-not)
-    ((x sequence &rest rest))
-  sequence)
+(defoptimizers constants (append nconc list*) ((&rest args))
+  (car (last args)))
 
 (defoptimizer (vector-to-list derive-type) ((vector))
   (when (typep (nth-value 1 (sequence-lvar-dimensions vector)) '(integer 1))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.