The s option now gives a percentage of the size of the input
This commit is contained in:
parent
dcde07e7a7
commit
6fc4ca1ae0
6 changed files with 15 additions and 13 deletions
|
@ -7,7 +7,7 @@ SHR=../share
|
||||||
LDFLAGS=-i
|
LDFLAGS=-i
|
||||||
CPPFLAGS=-DVERBOSE -DNOTCOMPACT
|
CPPFLAGS=-DVERBOSE -DNOTCOMPACT
|
||||||
CFLAGS=$(CPPFLAGS) -O
|
CFLAGS=$(CPPFLAGS) -O
|
||||||
LINTFLAGS=-phbac
|
LINTFLAGS=-hbac
|
||||||
|
|
||||||
CFILES=\
|
CFILES=\
|
||||||
il.c il1_anal.c il1_cal.c il1_formal.c il1_aux.c il2_aux.c \
|
il.c il1_anal.c il1_cal.c il1_formal.c il1_aux.c il2_aux.c \
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
int calnr;
|
int calnr;
|
||||||
int complete_program;
|
int complete_program;
|
||||||
calcnt_p cchead; /* call-count info of current proc */
|
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 cname[] = "/usr/tmp/ego.i1.XXXXXX";
|
||||||
STATIC char ccname[] = "/usr/tmp/ego.i2.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 em text in em-file */
|
||||||
/* address of graph in basic block file */
|
/* address of graph in basic block file */
|
||||||
curproc->P_SIZE = proclength(curproc); /* #instructions */
|
curproc->P_SIZE = proclength(curproc); /* #instructions */
|
||||||
|
total_size += curproc->P_SIZE;
|
||||||
if (BIG_PROC(curproc)) {
|
if (BIG_PROC(curproc)) {
|
||||||
/* curproc is too large to be expanded in line */
|
/* curproc is too large to be expanded in line */
|
||||||
UNSUITABLE(curproc);
|
UNSUITABLE(curproc);
|
||||||
|
@ -120,7 +122,7 @@ STATIC char cname2[] = "/usr/tmp/ego.i4.XXXXXX";
|
||||||
|
|
||||||
pass2(cnam,space)
|
pass2(cnam,space)
|
||||||
char *cnam;
|
char *cnam;
|
||||||
short space;
|
long space;
|
||||||
{
|
{
|
||||||
FILE *cf, *cf2, *ccf;
|
FILE *cf, *cf2, *ccf;
|
||||||
call_p c,a;
|
call_p c,a;
|
||||||
|
@ -283,6 +285,7 @@ il_flags(p)
|
||||||
while (*p != '\0') {
|
while (*p != '\0') {
|
||||||
space = 10*space +*p++ -'0';
|
space = 10*space +*p++ -'0';
|
||||||
}
|
}
|
||||||
|
space = total_size * space / 100 ;
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'a':
|
||||||
complete_program = 1;
|
complete_program = 1;
|
||||||
|
|
|
@ -164,12 +164,12 @@ short looplevel(b)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
short proclength(p)
|
int proclength(p)
|
||||||
proc_p p;
|
proc_p p;
|
||||||
{
|
{
|
||||||
/* count the number of EM instructions of p */
|
/* count the number of EM instructions of p */
|
||||||
|
|
||||||
register short cnt;
|
register int cnt;
|
||||||
register bblock_p b;
|
register bblock_p b;
|
||||||
register line_p l;
|
register line_p l;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ extern bool par_overlap(); /* (offset off1, int t1, offset off2, int t2)
|
||||||
extern short looplevel(); /* (bblock_p b)
|
extern short looplevel(); /* (bblock_p b)
|
||||||
* Determine the loop nesting level of 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
|
* Determine the number of EM instructions
|
||||||
* in p. Do not count pseudos.
|
* in p. Do not count pseudos.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -410,7 +410,7 @@ STATIC selected(a)
|
||||||
|
|
||||||
STATIC compare(x,best,space)
|
STATIC compare(x,best,space)
|
||||||
call_p x, *best;
|
call_p x, *best;
|
||||||
short space;
|
long space;
|
||||||
{
|
{
|
||||||
/* See if x is better than the current best choice */
|
/* 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)
|
STATIC call_p best_one(list,space)
|
||||||
call_p list;
|
call_p list;
|
||||||
short space;
|
long space;
|
||||||
{
|
{
|
||||||
/* Find the best candidate of the list
|
/* Find the best candidate of the list
|
||||||
* that has not already been selected. The
|
* 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 best = (call_p) 0;
|
||||||
call_p x,c;
|
call_p c;
|
||||||
|
|
||||||
for (c = list; c != (call_p) 0; c = c->cl_cdr) {
|
for (c = list; c != (call_p) 0; c = c->cl_cdr) {
|
||||||
if (IS_SELECTED(c)) {
|
if (IS_SELECTED(c)) {
|
||||||
|
@ -510,7 +510,7 @@ STATIC single_calls(proclist)
|
||||||
select_calls(proclist,ccf,space)
|
select_calls(proclist,ccf,space)
|
||||||
proc_p proclist;
|
proc_p proclist;
|
||||||
FILE *ccf;
|
FILE *ccf;
|
||||||
short space ;
|
long space ;
|
||||||
{
|
{
|
||||||
/* Select all calls that are to be expanded in line. */
|
/* Select all calls that are to be expanded in line. */
|
||||||
|
|
||||||
|
@ -699,7 +699,7 @@ append_abstract(a,p)
|
||||||
|
|
||||||
Sstatist(list,space)
|
Sstatist(list,space)
|
||||||
call_p list;
|
call_p list;
|
||||||
short space;
|
long space;
|
||||||
{
|
{
|
||||||
call_p c;
|
call_p c;
|
||||||
|
|
||||||
|
@ -718,7 +718,7 @@ Sstatist(list,space)
|
||||||
|
|
||||||
Sstat(proclist,space)
|
Sstat(proclist,space)
|
||||||
proc_p proclist;
|
proc_p proclist;
|
||||||
short space;
|
long space;
|
||||||
{
|
{
|
||||||
proc_p p;
|
proc_p p;
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,6 @@ remunit(kind,p,l)
|
||||||
register bblock_p b;
|
register bblock_p b;
|
||||||
bblock_p next;
|
bblock_p next;
|
||||||
Lindex pi;
|
Lindex pi;
|
||||||
loop_p lp;
|
|
||||||
|
|
||||||
if (kind == LDATA) {
|
if (kind == LDATA) {
|
||||||
remlines(l);
|
remlines(l);
|
||||||
|
|
Loading…
Reference in a new issue