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