aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-09-10 21:18:50 +0000
committerdos-reis <gdr@axiomatics.org>2011-09-10 21:18:50 +0000
commite53b01b6bf06c69f4eabf30241642594e1cc6909 (patch)
treeb96c20b7def9d625453852bdefe4f7b0562968ec /src
parent933f9087bd5606d7af5aa5fbb7aedec96a360290 (diff)
downloadopen-axiom-e53b01b6bf06c69f4eabf30241642594e1cc6909.tar.gz
* interp/g-opt.boot (doInlineCall): Tidy.
(canInlineVarDefinition): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/g-opt.boot8
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'.