xref: /original-bsd/usr.bin/f77/pass1.vax/optim.h (revision f238860a)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)optim.h	5.1 (Berkeley) 06/07/85
7  */
8 
9 /*
10  * structure to hold trees for optimization
11  */
12 
13 typedef struct slt {
14 	field 		type;
15 	field		flags;
16 	short		lineno;
17 	struct slt	*next, *prev;
18 	struct slt	*nullslot;
19 	expptr		expr;
20 	int		label;
21 	int		*ctlinfo;
22 };
23 
24 typedef struct slt *Slotp;
25 
26 extern Slotp	firstslot, lastslot;	/* first, last slots in buffer */
27 extern int	numslots;		/* number of slots */
28 
29 Slotp newslot(), optbuff(), optinsert();
30 struct Ctlframe *cpframe();
31 
32 /*
33 **      Structures for cse analysis
34 */
35 
36 typedef struct IDblock *idptr;
37 typedef struct VALUEnode *valuen;
38 typedef struct IDlist  *idlptr;
39 typedef struct DUPlist *duplptr;
40 typedef struct NODElist *nodelptr;
41 
42 struct IDblock
43 {
44 	expptr idaddr;
45 	valuen initval, assgnval;
46 	nodelptr headnodelist;
47 	struct IDblock *next;
48 };
49 
50 struct VALUEnode
51 {
52 	expptr opp;
53 	expptr *parent;
54 	int n_dups;
55 	unsigned is_dead : 1;
56 	valuen lc,rc,rs;
57 	idlptr headdeplist;
58 	duplptr headduplist;
59 	struct VALUEnode *next;
60 };
61 
62 struct IDlist
63 {
64 	idptr idp;
65 	struct IDlist *next;
66 };
67 
68 struct DUPlist
69 {
70 	expptr *parent;
71 	struct DUPlist *next;
72 };
73 
74 struct NODElist
75 {
76 	valuen nodep;
77 	struct NODElist *next;
78 };
79 
80 /*
81  * structure to hold information on basic blocks
82  */
83 
84 
85 
86 typedef struct bblock {
87 	Slotp		first, last;
88 	idptr		headid;
89 	valuen		headnode, tailnode;
90 	struct bblock	*next, *prev;
91 };
92 
93 typedef struct bblock *Bblockp;
94 
95 extern Bblockp	firstblock;		/* first block in buffer */
96 extern Bblockp	lastblock;		/* last block in buffer */
97 
98 
99 
100 /* data structure for optloop and regalloc routines */
101 
102 typedef
103   struct regnode
104     {
105       field vstg;
106       field vtype;
107       int memno;
108       int memoffset;
109       unsigned isarrayarg : 1;
110     } REGNODE;
111