summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStas Boukarev <stassats@gmail.com>2023-03-27 05:39:45 +0300
committerStas Boukarev <stassats@gmail.com>2023-03-27 05:41:31 +0300
commitf518315a201959dc2703095cd1e595a9d3e362d8 (patch)
treea09b13f521cdf0a785c284fe1f5bcfdfdf309343
parentd6dbe3db853dc3bb34dff0300a207070f5e171b5 (diff)
ir1-optimize-return: disable unused value optimization.
For now. Removing already propagated types for the unused values is complicated. Fixes lp#2012851 lp#2012852
-rw-r--r--src/compiler/ir1opt.lisp18
-rw-r--r--tests/compiler-ir.pure.lisp3
2 files changed, 12 insertions, 9 deletions
diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp
index 51476e6ba..ab709ed9b 100644
--- a/src/compiler/ir1opt.lisp
+++ b/src/compiler/ir1opt.lisp
@@ -677,7 +677,8 @@
(defun ir1-optimize-return (node)
(declare (type creturn node))
(let ((lambda (return-lambda node))
- single-value-p)
+ ;; single-value-p
+ )
(when (and
(singleton-p (tail-set-funs (lambda-tail-set lambda)))
(dolist (ref (leaf-refs lambda)
@@ -689,8 +690,9 @@
(eq (combination-kind combination) :local)
(eq (combination-fun combination) lvar)
(not (or (and (node-lvar combination)
- (not (setf single-value-p
- (lvar-single-value-p (node-lvar combination)))))
+ ;; (not (setf single-value-p
+ ;; (lvar-single-value-p (node-lvar combination))))
+ )
(node-tail-p combination))))
(return)))))
;; Delete the uses if the result is not used anywhere
@@ -721,11 +723,11 @@
;; because they can be tail called.
(unless (flushable-combination-p node)
(return t))))))
- (single-value-p
- (unless (type-single-value-p (lvar-derived-type lvar))
- (filter-lvar lvar (lambda (x) `(values ,x)))
- (erase-types (make-single-value-type (lvar-type lvar)))
- (return-from ir1-optimize-return)))
+ ;; (single-value-p
+ ;; (unless (type-single-value-p (lvar-derived-type lvar))
+ ;; (filter-lvar lvar (lambda (x) `(values ,x)))
+ ;; (erase-types (make-single-value-type (lvar-type lvar)))
+ ;; (return-from ir1-optimize-return)))
((not (and (combination-p combination)
(lvar-fun-is (combination-fun combination) '(values))
(null (combination-args combination))))
diff --git a/tests/compiler-ir.pure.lisp b/tests/compiler-ir.pure.lisp
index bbbf6b41f..7d868cce2 100644
--- a/tests/compiler-ir.pure.lisp
+++ b/tests/compiler-ir.pure.lisp
@@ -396,7 +396,8 @@
(eq (sb-c::functional-kind fun) :let))))
calls)))))
-(with-test (:name :unused-flet-values)
+(with-test (:name :unused-flet-values
+ :fails-on :sbcl)
(let ((calls (ir-full-calls
`(lambda (x y)
(flet ((f ()