run peephole optimizer after inline substitution

This commit is contained in:
ceriel 1988-06-21 15:20:49 +00:00
parent 860230a837
commit 46c8b743f2

View file

@ -3,6 +3,8 @@ DDUMP=$TMP.dd.$$
PDUMP=$TMP.pd.$$ PDUMP=$TMP.pd.$$
PHASES='' PHASES=''
FLAGS='' FLAGS=''
EM=$1
shift
while : while :
@ -15,7 +17,7 @@ do
case $A in case $A in
*.m|*.ma) ICARG="$ICARG $A"; continue;; *.m|*.ma) ICARG="$ICARG $A"; continue;;
-P) OPT="$1"; shift; continue;; -P) OPT="$1"; shift; continue;;
-IL) PHASES="$PHASES il cf " ; continue;; -IL) PHASES="$PHASES il cf caopt ic cf " ; continue;;
-CS) PHASES="$PHASES cs " ; continue;; -CS) PHASES="$PHASES cs " ; continue;;
-SR) PHASES="$PHASES sr " ; continue;; -SR) PHASES="$PHASES sr " ; continue;;
-UD) PHASES="$PHASES ud " ; continue;; -UD) PHASES="$PHASES ud " ; continue;;
@ -42,7 +44,7 @@ fi
for i in $PASSES for i in $PASSES
do INFILES=$OUTFILES do INFILES=$OUTFILES
OUTFILES="$TMP.p.$c.$$ $TMP.d.$c.$$ $TMP.l.$c.$$ $TMP.b.$c.$$" OUTFILES="$TMP.p.$c.$$ $TMP.d.$c.$$ $TMP.l.$c.$$ $TMP.b.$c.$$"
trap "rm -f $INFILES $OUTFILES $PDUMP $DDUMP; exit 1" 1 2 15 trap "rm -f $INFILES $OUTFILES $PDUMP $DDUMP $TMPOPT; exit 1" 1 2 15
case $i in case $i in
ic) if $OPT/ic $INFILES - - $OUTFILES $ICARG ic) if $OPT/ic $INFILES - - $OUTFILES $ICARG
then : then :
@ -50,11 +52,23 @@ do INFILES=$OUTFILES
fi ;; fi ;;
ca) if $OPT/ca $INFILES $PDUMP $DDUMP - - ca) if $OPT/ca $INFILES $PDUMP $DDUMP - -
then then
rm -f $INFILES $PDUMP $DDUMP rm -f $INFILES $PDUMP $DDUMP $TMPOPT
else else
rm -f $INFILES $PDUMP $DDUMP rm -f $INFILES $PDUMP $DDUMP $TMPOPT
exit 1 exit 1
fi;; fi;;
caopt) rm -f $TMPOPT
TMPOPT=$TMP.o.$$
if $OPT/ca $INFILES $PDUMP $DDUMP - - | $EM/lib/em_opt2 > $TMPOPT
then
rm -f $INFILES $PDUMP $DDUMP
else
rm -f $INFILES $PDUMP $DDUMP $TMPOPT
exit 1
fi
ICARG=$TMPOPT
OUTFILES="$PDUMP $DDUMP"
;;
*) if $OPT/$i $INFILES $OUTFILES $FLAGS *) if $OPT/$i $INFILES $OUTFILES $FLAGS
then then
rm -f $INFILES rm -f $INFILES