From 39891edd1214c0db9541709ce71c4b9745ce8cf7 Mon Sep 17 00:00:00 2001 From: bal Date: Fri, 30 Nov 1984 10:27:05 +0000 Subject: [PATCH] Declarations for iv and code_info added (moved from types.h). core allocation macros added. --- util/ego/sr/sr.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/util/ego/sr/sr.h b/util/ego/sr/sr.h index 987473ca2..7ff40b0d1 100644 --- a/util/ego/sr/sr.h +++ b/util/ego/sr/sr.h @@ -5,6 +5,42 @@ */ +typedef struct iv *iv_p; +typedef struct code_info *code_p; + +/* An induction variable */ + +struct iv { + offset iv_off; /* offset of the induction variable */ + line_p iv_incr; /* pointer to last instr. of EM-code that + * increments the induction variable */ + offset iv_step; /* step value */ +}; + + +/* All information about a reducible piece of code is collected in + * a single structure. + */ + +struct code_info { + loop_p co_loop; /* the loop the code is in */ + bblock_p co_block; /* the basic block the code is in */ + line_p co_lfirst; /* first instruction of the code */ + line_p co_llast; /* last instruction of the code */ + line_p co_ivexpr; /* start of linear expr. using iv */ + line_p co_endexpr; /* end of the expression */ + int co_sign; /* sign of iv in above expr */ + iv_p co_iv; /* the induction variable */ + offset co_temp; /* temporary variable */ + int co_tmpsize; /* size of the temp. variable (ws or ps)*/ + int co_instr; /* the expensive instruction (mli,lar..)*/ + union { + line_p co_loadlc; /* LOC lc instruction (for mult.)*/ + line_p co_desc; /* load address of descriptor + * (for lar etc.) */ + } c_o; +}; + #define LOAD 0 #define STORE 1 @@ -26,3 +62,11 @@ extern bool arrbound_harmful; /* Is it harmful to take the address of * a non-existing array element ? */ extern int Ssr; /* #optimizations found */ + +/* core allocation macros */ +#define newiv() (iv_p) newstruct(iv) +#define newcinfo() (code_p) newstruct(code_info) +#define newsrlpx() (lpext_p) newstruct(lpext_sr) +#define oldiv(x) oldstruct(iv,x) +#define oldcinfo(x) oldstruct(code_info,x) +#define oldsrlpx(x) oldstruct(lpext_sr,x) -- 2.34.1