From 82e14fe9c4583921537b66c2d5cfc01e09831315 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 21 Dec 2018 21:49:52 -0500 Subject: [PATCH] Experimental changes: 1) Disable beta expansion (causes exponential growth problems on compiler benchmark, needs more fine-tuning) 2) Do not inline assoc/member functions since they loop (needs performance analysis) --- scheme/cyclone/cps-optimizations.sld | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scheme/cyclone/cps-optimizations.sld b/scheme/cyclone/cps-optimizations.sld index bc37d082..bf385db6 100644 --- a/scheme/cyclone/cps-optimizations.sld +++ b/scheme/cyclone/cps-optimizations.sld @@ -988,6 +988,8 @@ (every (lambda (arg) (and (prim-call? arg) + ;; Do not inline functions that are looping over lists, seems counter-productive + (not (member (car arg) '( member assoc Cyc-fast-member Cyc-fast-assoc assq assv memq memv))) (not (prim:cont? (car arg))))) (cdr exp)) ;; Disallow primitives that allocate a new obj, @@ -1609,10 +1611,11 @@ (analyze-cps ast) (trace:info "---------------- cps analysis db:") (trace:info (adb:get-db)) - (opt:beta-expand + ;(opt:beta-expand ;; TODO: temporarily disabled, causes problems with massive expansions in compiler benchmark, need to revist how to throttle/limit this (program size? heuristics? what else??) (opt:inline-prims (opt:contract ast) - -1)) + -1) + ;) ) ;; Renumber lambdas and re-run analysis