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