diff options
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b1f80cb7..59028ed2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2011-09-10 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/g-opt.boot (doInlineCall): Tidy. + (canInlineVarDefinition): Likewise. + +2011-09-10 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/macros.lisp (COERCE-FAILURE-MSG): Remove. (check-subtype): Likewise. (check-union): Likewise. diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index e26c8089..287e5f7d 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -280,9 +280,8 @@ doInlineCall(args,parms,body) == for arg in args for parm in parms repeat g := gensym() tmps := [g,:tmps] - sideEffectFree? arg - or (numOfOccurencesOf(parm,body) < 2 and isSimpleVMForm body) => - subst := [[g,:arg],:subst] + sideEffectFree? arg or numOfOccurencesOf(parm,body) = 1 => + subst := [[g,:arg],:subst] inits := [[g,arg],:inits] -- 4. Alpha-rename the body and substitute simple expression arguments. body := applySubst(pairList(parms,reverse! tmps),body) @@ -546,7 +545,8 @@ canInlineVarDefinition(var,expr,body) == -- Linearly used internal temporaries should be replaced, and -- so should side-effet free initializers for linear variables. usageCount := numOfOccurencesOf(var,body) - usageCount < 2 and (gensym? var or sideEffectFree? expr) => true + usageCount < 2 and sideEffectFree? expr => true + gensym? var and usageCount = 1 => true -- If the initializer is a variable and the body is -- a series of choices with side-effect free predicates, then -- no harm is done by removing the local `var'. |