Commit | Line | Data |
---|---|---|
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 | ||
16 | typedef 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 | ||
27 | typedef struct slt *Slotp; | |
28 | ||
29 | extern Slotp firstslot, lastslot; /* first, last slots in buffer */ | |
30 | extern int numslots; /* number of slots */ | |
31 | ||
32 | Slotp newslot(), optbuff(), optinsert(); | |
33 | struct Ctlframe *cpframe(); | |
34 | ||
35 | /* | |
36 | ** Structures for cse analysis | |
37 | */ | |
38 | ||
39 | typedef struct IDblock *idptr; | |
40 | typedef struct VALUEnode *valuen; | |
41 | typedef struct IDlist *idlptr; | |
42 | typedef struct DUPlist *duplptr; | |
43 | typedef struct NODElist *nodelptr; | |
44 | ||
45 | struct IDblock | |
46 | { | |
47 | expptr idaddr; | |
48 | valuen initval, assgnval; | |
49 | nodelptr headnodelist; | |
50 | struct IDblock *next; | |
51 | }; | |
52 | ||
53 | struct 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 | ||
65 | struct IDlist | |
66 | { | |
67 | idptr idp; | |
68 | struct IDlist *next; | |
69 | }; | |
70 | ||
71 | struct DUPlist | |
72 | { | |
73 | expptr *parent; | |
74 | struct DUPlist *next; | |
75 | }; | |
76 | ||
77 | struct NODElist | |
78 | { | |
79 | valuen nodep; | |
80 | struct NODElist *next; | |
81 | }; | |
82 | ||
83 | /* | |
84 | * structure to hold information on basic blocks | |
85 | */ | |
86 | ||
87 | ||
88 | ||
89 | typedef struct bblock { | |
90 | Slotp first, last; | |
91 | idptr headid; | |
92 | valuen headnode, tailnode; | |
93 | struct bblock *next, *prev; | |
94 | }; | |
95 | ||
96 | typedef struct bblock *Bblockp; | |
97 | ||
98 | extern Bblockp firstblock; /* first block in buffer */ | |
99 | extern Bblockp lastblock; /* last block in buffer */ | |
100 | ||
101 | ||
102 | ||
103 | /* data structure for optloop and regalloc routines */ | |
104 | ||
105 | typedef | |
106 | struct regnode | |
107 | { | |
108 | field vstg; | |
109 | field vtype; | |
110 | int memno; | |
111 | int memoffset; | |
112 | unsigned isarrayarg : 1; | |
113 | } REGNODE; |