The s option now gives a percentage of the size of the input

This commit is contained in:
ceriel 1989-02-09 10:18:48 +00:00
parent dcde07e7a7
commit 6fc4ca1ae0
6 changed files with 15 additions and 13 deletions

View file

@ -7,7 +7,7 @@ SHR=../share
LDFLAGS=-i
CPPFLAGS=-DVERBOSE -DNOTCOMPACT
CFLAGS=$(CPPFLAGS) -O
LINTFLAGS=-phbac
LINTFLAGS=-hbac
CFILES=\
il.c il1_anal.c il1_cal.c il1_formal.c il1_aux.c il2_aux.c \

View file

@ -26,7 +26,8 @@
int calnr;
int complete_program;
calcnt_p cchead; /* call-count info of current proc */
STATIC short space = 0;
STATIC long space = 0;
STATIC long total_size = 0;
STATIC char cname[] = "/usr/tmp/ego.i1.XXXXXX";
STATIC char ccname[] = "/usr/tmp/ego.i2.XXXXXX";
@ -87,6 +88,7 @@ pass1(lnam,bnam,cnam)
/* address of em text in em-file */
/* address of graph in basic block file */
curproc->P_SIZE = proclength(curproc); /* #instructions */
total_size += curproc->P_SIZE;
if (BIG_PROC(curproc)) {
/* curproc is too large to be expanded in line */
UNSUITABLE(curproc);
@ -120,7 +122,7 @@ STATIC char cname2[] = "/usr/tmp/ego.i4.XXXXXX";
pass2(cnam,space)
char *cnam;
short space;
long space;
{
FILE *cf, *cf2, *ccf;
call_p c,a;
@ -283,6 +285,7 @@ il_flags(p)
while (*p != '\0') {
space = 10*space +*p++ -'0';
}
space = total_size * space / 100 ;
break;
case 'a':
complete_program = 1;

View file

@ -164,12 +164,12 @@ short looplevel(b)
short proclength(p)
int proclength(p)
proc_p p;
{
/* count the number of EM instructions of p */
register short cnt;
register int cnt;
register bblock_p b;
register line_p l;

View file

@ -30,7 +30,7 @@ extern bool par_overlap(); /* (offset off1, int t1, offset off2, int t2)
extern short looplevel(); /* (bblock_p b)
* Determine the loop nesting level of b.
*/
extern short proclength(); /* (proc_p p)
extern int proclength(); /* (proc_p p)
* Determine the number of EM instructions
* in p. Do not count pseudos.
*/

View file

@ -410,7 +410,7 @@ STATIC selected(a)
STATIC compare(x,best,space)
call_p x, *best;
short space;
long space;
{
/* See if x is better than the current best choice */
@ -428,7 +428,7 @@ STATIC compare(x,best,space)
STATIC call_p best_one(list,space)
call_p list;
short space;
long space;
{
/* Find the best candidate of the list
* that has not already been selected. The
@ -438,7 +438,7 @@ STATIC call_p best_one(list,space)
*/
call_p best = (call_p) 0;
call_p x,c;
call_p c;
for (c = list; c != (call_p) 0; c = c->cl_cdr) {
if (IS_SELECTED(c)) {
@ -510,7 +510,7 @@ STATIC single_calls(proclist)
select_calls(proclist,ccf,space)
proc_p proclist;
FILE *ccf;
short space ;
long space ;
{
/* Select all calls that are to be expanded in line. */
@ -699,7 +699,7 @@ append_abstract(a,p)
Sstatist(list,space)
call_p list;
short space;
long space;
{
call_p c;
@ -718,7 +718,7 @@ Sstatist(list,space)
Sstat(proclist,space)
proc_p proclist;
short space;
long space;
{
proc_p p;

View file

@ -156,7 +156,6 @@ remunit(kind,p,l)
register bblock_p b;
bblock_p next;
Lindex pi;
loop_p lp;
if (kind == LDATA) {
remlines(l);