master: delete-no-op-vops: transfer tn-readers too

stassats via Sbcl-commits <[email protected]> Mon, 29 Jun 2026 23:46:49 +0000
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  3f79152d61de759a0da552e62e7a9287ba567b76 (commit)
      from  ca75aca96aed5e9fe016b20758ffa9e5df6b56fe (commit)

- Log -----------------------------------------------------------------
commit 3f79152d61de759a0da552e62e7a9287ba567b76
Author: Stas Boukarev <[email protected]>
Date:   Tue Jun 30 02:43:53 2026 +0300

    delete-no-op-vops: transfer tn-readers too
    
    To avoid confusing peephole optimizers
    
    Reported by Scott L. Burson.
---
 src/compiler/ir2opt.lisp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/compiler/ir2opt.lisp b/src/compiler/ir2opt.lisp
index b8f65619b..45899fdfb 100644
--- a/src/compiler/ir2opt.lisp
+++ b/src/compiler/ir2opt.lisp
@@ -337,6 +337,12 @@
               (let ((transferred (eq (tn-sc x) (tn-sc y))))
                 (when transferred
                   (loop with ref = (tn-writes x)
+                        while ref
+                        do
+                        (let ((next (tn-ref-next ref)))
+                          (change-tn-ref-tn ref y)
+                          (setf ref next)))
+                  (loop with ref = (tn-reads x)
                         while ref
                         do
                         (let ((next (tn-ref-next ref)))

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


hooks/post-receive
-- 
SBCL