File:  [Research Unix] / researchv9 / jerq / sgs / optim / peep.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:22:00 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

/* @(#) peep.c: 1.2 3/3/84				*/
/* peep.c
**
**	3B20S peephole improvement driver
**
**
** This module contains the driver for the 3B peephole improver.
*/




#include "optim.h"

extern void w1opt();
extern void w2opt();
extern void w3opt();
extern int window();

extern int dflag;			/* non-0 to display live/dead data */
extern int hflag;			/* non-0 to disable peephole entirely */
void peep()
{
    void prld();			/* routine to print live/dead data */


    if (hflag == 0)
    {
#ifdef LIVEDEAD
	if (dflag != 0)			/* if enabled */
	    prld();			/* print the world's live/dead data */
#endif

	window(2, w2opt);		/* do 2-instruction first to merge
					** triadics
					*/
	window(3, w3opt);		/* ... to discard extra compares */
	window(1, w1opt);		/* do 1-instruction next to kill dead
					** code, split triadics again (!)
					*/

	window(2, w2opt);		/* now repeat to clean up stragglers */
	window(1, w1opt);
    }
    return;
}
/* Print live/dead data for all instruction nodes */

#ifdef LIVEDEAD


void
prld()
{
    register NODE * p;
    int prinst();

    for (ALLN(p))			/* for all instruction nodes... */
    {
	PUTCHAR(CC);			/* write comment char */

	PRINTF("(live: 0x%X)", p->nlive); /* print live/dead data */
	(void) prinst(p);			/* print instruction */
    }
    return;
}

#endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.