1 /*
2  * Copyright (c) 1993-2019, NVIDIA CORPORATION.  All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef ILT_H_
19 #define ILT_H_
20 
21 /** \file
22  * \brief ILT data structures and definitions
23  */
24 
25 typedef struct {
26   int ilip;
27   union {
28     UINT all;
29     struct {
30       unsigned ex : 1;
31       unsigned st : 1;
32       unsigned br : 1; /* ILT can branch */
33       unsigned lb : 1;
34       unsigned dbgline : 1;
35       unsigned delete_ : 1;
36       unsigned ignore : 1; /* used by hl vectorizer */
37       unsigned split : 1;  /* split the loop here */
38       unsigned cplx : 1;   /* pseudo store of complex store sequence */
39       unsigned mcache : 1; /* store guaranteed to miss cache */
40       unsigned nodel : 1;  /* fp store cannot be deleted */
41       unsigned keep : 1;   /* don't delete */
42       unsigned delebb : 1; /* delete store if its subsequent use appears
43                             * in the same extended basic block */
44       unsigned predc : 1;  /* ILT serves to combine two guards */
45       unsigned eqasrt : 1; /* if set, ilt is for a store used to assert
46                             * that a variable has the given value
47                             */
48       unsigned free : 1;   /* ilt is free - it's in the free list */
49       unsigned class_ : 5; /* used in accelerator compiler */
50       unsigned extra : 1;  /* also used in accelerator compiler */
51       unsigned extra2 : 1; /* also used in accelerator compiler */
52       unsigned inv : 1;    /* hoisted invariant */
53       unsigned acc_disabled : 1; /* ILT will be disabled at GPU CG */
54       unsigned spare : 7;
55     } bits;
56   } flags;
57   int prev;
58   int next;
59   int order; /* used to keep track of order within a block */
60   int lineno;
61   int findex;
62   int oldilt;
63 } ILT;
64 
65 typedef struct {
66   STG_MEMBERS(ILT);
67   int curilt;
68   int callfg;
69   char ldvol;   /* Volatile load flag */
70   char stvol;   /* Volatile store flag */
71   bool qjsrfg;  /* QJSR flag */
72   char privtmp; /* private temp state; DEBUG-only dmpilt() sets */
73 } ILTB;
74 
75 #define ILT_ILIP(i) iltb.stg_base[i].ilip
76 #define ILT_LINENO(i) iltb.stg_base[i].lineno
77 #define ILT_OLDILT(i) iltb.stg_base[i].oldilt
78 #define ILT_FINDEX(i) iltb.stg_base[i].findex
79 #define ILT_PREV(i) iltb.stg_base[i].prev
80 #define ILT_NEXT(i) iltb.stg_base[i].next
81 #define ILT_ORDER(i) iltb.stg_base[i].order
82 #define ILT_FLAGS(i) iltb.stg_base[i].flags.all
83 #define ILT_EX(i) iltb.stg_base[i].flags.bits.ex
84 #define ILT_ST(i) iltb.stg_base[i].flags.bits.st
85 #define ILT_BR(i) iltb.stg_base[i].flags.bits.br
86 #define ILT_ACC_DISABLED(i) iltb.stg_base[i].flags.bits.acc_disabled
87 #define ILT_CAN_THROW(i) (0)
88 #define ILT_SET_CAN_THROW(i, value) ((void)0)
89 #define ILT_BR_OR_CAN_THROW(i) (ILT_BR(i) || ILT_CAN_THROW(i))
90 #define ILT_LB(i) iltb.stg_base[i].flags.bits.lb
91 #define ILT_DBGLINE(i) iltb.stg_base[i].flags.bits.dbgline
92 #define ILT_DELETE(i) iltb.stg_base[i].flags.bits.delete_
93 #define ILT_IGNORE(i) iltb.stg_base[i].flags.bits.ignore
94 #define ILT_SPLIT(i) iltb.stg_base[i].flags.bits.split
95 #define ILT_CPLX(i) iltb.stg_base[i].flags.bits.cplx
96 #define ILT_MCACHE(i) iltb.stg_base[i].flags.bits.mcache
97 #define ILT_NODEL(i) iltb.stg_base[i].flags.bits.nodel
98 #define ILT_KEEP(i) iltb.stg_base[i].flags.bits.keep
99 #define ILT_DELEBB(i) iltb.stg_base[i].flags.bits.delebb
100 #define ILT_PREDC(i) iltb.stg_base[i].flags.bits.predc
101 #define ILT_EQASRT(i) iltb.stg_base[i].flags.bits.eqasrt
102 #define ILT_FREE(i) iltb.stg_base[i].flags.bits.free
103 #define ILT_INV(i) iltb.stg_base[i].flags.bits.inv
104 
105 /*****  ILT External Data Declarations *****/
106 
107 extern ILTB iltb;
108 
109 #include "iltutil.h"
110 
111 #endif // ILT_H_
112