several data structures added (moved from types.h).
authorbal <none@none>
Fri, 30 Nov 1984 10:28:35 +0000 (10:28 +0000)
committerbal <none@none>
Fri, 30 Nov 1984 10:28:35 +0000 (10:28 +0000)
core allocation macros added.

util/ego/il/il.h

index fb5e4b4..56f7821 100644 (file)
@@ -5,6 +5,84 @@
  */
 
 
+typedef struct actual  *actual_p;
+typedef struct calcnt  *calcnt_p;
+typedef short call_id;
+
+struct call {
+       proc_p   cl_caller;     /* calling procedure                    */
+       call_id  cl_id;         /* uniquely denotes a CAL instruction   */
+       proc_p   cl_proc;       /* the called procedure                 */
+       byte     cl_looplevel;  /* loop nesting level of the CAL        */
+       bool     cl_flags;      /* flag bits                            */
+       short    cl_ratio;      /* indicates 'speed gain / size lost'   */
+       call_p   cl_cdr;        /* link to next call                    */
+       call_p   cl_car;        /* link to nested calls                 */
+       actual_p cl_actuals;    /* actual parameter expr. trees         */
+};
+
+#define CLF_INLPARS 017                /* min(15,nr. of inline parameters) */
+#define CLF_SELECTED   020     /* is call selected for expansion? */
+#define CLF_EVER_EXPANDED 040  /* ever expanded? e.g. in a nested call.  */
+#define CLF_FIRM       0100    /* indicates if the call takes place in a
+                                * firm block of a loop (i.e. one that
+                                * is always executed, except
+                                * -perhaps- at the last iteration).
+                                * Used for heuristics only.
+                                */
+
+struct actual {
+       line_p   ac_exp;        /* copy of EM text                      */
+                               /* 0 for actuals that are not inline    */
+       offset   ac_size;       /* number of bytes of parameter         */
+       bool     ac_inl;        /* TRUE if it may be expanded in line   */
+       actual_p ac_next;       /* link                                 */
+};
+
+
+struct formal {
+       offset   f_offset;      /* offsetin bytes                       */
+       byte     f_flags;       /* flags FF_BAD etc.                    */
+       byte     f_type;        /* SINGLE, DOUBLE,POINTER,UNKNOWN       */
+       formal_p f_next;        /* link                                 */
+};
+
+
+/* flags of formal: */
+
+#define FF_BAD         01
+#define FF_REG         02
+#define        FF_ONCEUSED     04
+#define FF_OFTENUSED   06
+#define USEMASK                014
+
+/* types of formals: */
+
+#define SINGLE         1
+#define DOUBLE         2
+#define POINTER                3
+#define UNKNOWN                4
+
+/* 'call-count' information keeps track of the number
+ * of times one procedure calls another. Conceptually,
+ * it may be regarded as a two dimensional array, where
+ * calcnt[p,q] is the number of times p calls q. As this
+ * matrix would be very dense, we use a more efficient
+ * list representation. Every procedure has a list
+ * of calcnt structs.
+ */
+
+struct calcnt {
+       proc_p  cc_proc;        /* the called procedure */
+       short   cc_count;       /* # times proc. is called in the
+                                * original text of the caller.
+                                */
+       calcnt_p cc_next;       /* link                 */
+};
+
+
+
+
 extern int calnr;
 extern calcnt_p cchead;                /* calcnt info of current proc */
 
@@ -67,3 +145,17 @@ extern int Ssubst;
 extern int Senv,Srecursive,Slocals,Sinstrlab,Sparsefails,Spremoved,Scals;
 extern int Sbig_caller,Sdispensable,Schangedcallee,Sbigcallee,Sspace,Szeroratio;
 #endif
+
+/* extra core-allocation macros */
+
+#define newcall()      (call_p) newstruct(call)
+#define newactual()    (actual_p) newstruct(actual)
+#define newformal()    (formal_p) newstruct(formal)
+#define newcalcnt()    (calcnt_p) newstruct(calcnt)
+#define newilpx()      (pext_p) newstruct(pext_il)
+
+#define oldcall(x)     oldstruct(call,x)
+#define oldactual(x)   oldstruct(actual,x)
+#define oldformal(x)   oldstruct(formal,x)
+#define oldcalcnt(x)   oldstruct(calcnt,x)
+#define oldilpx(x)     oldstruct(pext_il,x)