[Chicken-hackers] [PATCH] Revert half of "Add some optimizer simplification rules"

2019-09-16 Thread megane
Hi,

This reverts the rewrite that unearthed #1648.

>From 896601d3fd9fd9e9e1a0bac407dccbf0e4bed1e8 Mon Sep 17 00:00:00 2001
From: megane 
Date: Mon, 16 Sep 2019 12:04:49 +0300
Subject: [PATCH] Revert half of "Add some optimizer simplification rules"

This causes uri-generic to fail to compile in similar way #1648 does.
---
 optimizer.scm | 32 
 1 file changed, 32 deletions(-)

diff --git a/optimizer.scm b/optimizer.scm
index fc2d3165..bd163710 100644
--- a/optimizer.scm
+++ b/optimizer.scm
@@ -830,38 +830,6 @@
args1)
  nargs)
#t))
-(else (loop (cdr args)
-(cons (car args) nargs)
-ok)))
-
- ;; (let (( (##core#inline  ...)))
- ;;   ( ...  ...))
- ;; -> ( ... (##core#inline  ...) ...)
- ;;  ...))
- ;; -  is used only once.
- `((let (var) (##core#inline (op) . args1)
-  (##core#call p . args2))
-(var op args1 p args2)
-,(lambda (db may-rewrite var op args1 p args2)
-   (and may-rewrite   ; give other optimizations a chance first
-(= 1 (length (db-get-list db var 'references)))
-(let loop ((args args2) (nargs '()) (ok #f))
-  (cond ((null? args)
- (and ok
-  (make-node 
-   '##core#call p
-   (reverse nargs
-((and (eq? '##core#variable
-   (node-class (car args)))
-  (eq? var
-   (car (node-parameters (car args)
- (loop (cdr args)
-   (cons (make-node
-   '##core#inline
-   (list op)
-   args1)
- nargs)
-   #t))
 (else (loop (cdr args)
 (cons (car args) nargs)
 ok
-- 
2.17.1

___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers


Re: [Chicken-hackers] [PATCH] Some simplification rules for nested ##core#inline forms

2019-09-16 Thread megane

Peter Bex  writes:

> On Wed, Sep 04, 2019 at 11:59:31AM +0200, felix.winkelm...@bevuta.com wrote:
>> The attached patch adds two optimization rules for certain uses of
>> ##core#inline. It basically rewrites
>> 
>> (let (( (##core#inline ...)))
>>   ( ...  ...))
>> 
>> into
>> 
>> ( ... (##core##inline ...) ...)
>
> It looks like there's a problem caused by this:
>
> https://salmonella-freebsd-x86-64.call-cc.org/master/clang/freebsd/x86-64/2019/09/16/salmonella-report/install/uri-generic.html
>
> uri-generic uses matchable, which presumably generates a lot of
> code which looks like it should fit the pattern.
>

Here's a simplified version that does the OOM here:

(module uri-generic
(uri-relative-from)

(import scheme)

(define (uri-relative-from uabs base)
  (dif-segs-from uabs base))

(define (dif-segs-from sabs base)
  (if (null? base)
  sabs
  (dif-segs-from sabs base

___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers


Re: [Chicken-hackers] [PATCH] Some simplification rules for nested ##core#inline forms

2019-09-16 Thread Peter Bex
On Wed, Sep 04, 2019 at 11:59:31AM +0200, felix.winkelm...@bevuta.com wrote:
> The attached patch adds two optimization rules for certain uses of
> ##core#inline. It basically rewrites
> 
> (let (( (##core#inline ...)))
>   ( ...  ...))
> 
> into
> 
> ( ... (##core##inline ...) ...)

It looks like there's a problem caused by this:

https://salmonella-freebsd-x86-64.call-cc.org/master/clang/freebsd/x86-64/2019/09/16/salmonella-report/install/uri-generic.html

uri-generic uses matchable, which presumably generates a lot of
code which looks like it should fit the pattern.

Interestingly, nothing else that depends on matchable breaks:
https://salmonella-freebsd-x86-64.call-cc.org/master/clang/freebsd/x86-64/2019/09/16/salmonella-report/rev-dep-graphs/matchable.html

(there are a few red ones but they're due to missing C library packages)

Cheers,
Peter


signature.asc
Description: PGP signature
___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers