diff options
author | dos-reis <gdr@axiomatics.org> | 2011-09-10 21:18:50 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-09-10 21:18:50 +0000 |
commit | e53b01b6bf06c69f4eabf30241642594e1cc6909 (patch) | |
tree | b96c20b7def9d625453852bdefe4f7b0562968ec /src/interp | |
parent | 933f9087bd5606d7af5aa5fbb7aedec96a360290 (diff) | |
download | open-axiom-e53b01b6bf06c69f4eabf30241642594e1cc6909.tar.gz |
* interp/g-opt.boot (doInlineCall): Tidy.
(canInlineVarDefinition): Likewise.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/g-opt.boot | 8 |
1 files changed, 4 insertions, 4 deletions
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'. |