aa
TestNode.java
Go to the documentation of this file.
1 package com.cliffc.aa.node;
2 
3 import com.cliffc.aa.Env;
4 import com.cliffc.aa.GVNGCM;
5 import com.cliffc.aa.type.*;
7 import com.cliffc.aa.util.Util;
8 import org.junit.Test;
9 
10 import java.util.Arrays;
11 import java.util.HashMap;
12 
13 import static com.cliffc.aa.type.TypeFld.Access;
14 import static org.junit.Assert.assertEquals;
15 
16 public class TestNode {
17  // A private set of input nodes to feed into each tested Node - a hand-rolled
18  // sub-graph.
19  private Node[] _ins;
20  // A private GVN for computing value() calls.
21  private GVNGCM _gvn;
22 
23  // Types being used for testing
24  private Type[] _alltypes;
25 
26  // A sparse list of all subtypes. The outer array is the index into
27  // Type._alltypes(), and the inner array is the set of immediate sub-Types
28  // (again as indices into _alltypes). Numbers are sorted.
29  private int[][] _subtypes;
30 
31  // Build a minimal spanning sub-Type tree from the set of sample types.
32  // We'll use this to know which other types sub-Type this type... and thus be
33  // more efficient in testing all Types which subtype another Type. The outer
34  // array is the index into Type._alltypes(), and the inner array is the set
35  // of immediate sub-Types (again as indices into _alltypes).
36  private int[][] _min_subtypes;
37 
39  private static long hash( long h ) {
40  h ^= (h>>>20) ^ (h>>>12);
41  h ^= (h>>> 7) ^ (h>>> 4);
42  h += h<<7; // smear low bits up high, for hashcodes that only differ by 1
43  return h;
44  }
45  private Type get( long h ) { return _values.get(hash(h)); }
46  private Type put( long h, Type t ) { return _values.put(hash(h),t); }
47 
48  // Array doubling of longs
49  private long[] _work = new long[1];
50  private int _work_len;
51 
52  private int _errs;
53 
54  // temp/junk holder for "instant" junits, when debugged moved into other tests
55  @Test public void testNode() {
57  }
58 
59  // A sparse list of all subtypes. The outer array is the index into
60  // _alltypes, and the inner array is the set of immediate sub-Types
61  // (again as indices into _alltypes). _alltypes is sorted by 'isa'. Numbers
62  // in subs[i] are sorted and always greater than 'i'.
63  private int[][] make_subtypes() {
64  // First simplify alltype ptrs - nodes can only produce and consume simple ptr types.
65  for( int i=0; i<_alltypes.length; i++ ) {
66  _alltypes[i] = _alltypes[i].simple_ptr();
67  assert i==0 || _alltypes[i] != _alltypes[i-1]; // Quick check for dups
68  }
69 
70  int[][] subs = new int[_alltypes.length][];
71  int[] tmp = new int[_alltypes.length];
72  for( int i=0; i<subs.length; i++ ) {
73  int len=0;
74  for( int j=0; j<subs.length; j++ )
75  if( i!=j && _alltypes[i].isa(_alltypes[j]) )
76  tmp[len++]=j; // isa numbers are sorted by increasing 'j'
77  subs[i] = Arrays.copyOfRange(tmp,0,len);
78  }
79  return subs;
80  }
81 
82  // Build a minimal subtype graph from the set of sample types. We'll use
83  // this to know which other types sub-Type this type... and thus be more
84  // efficient in testing all Types which subtype another Type. The outer
85  // array is the index into Type._alltypes(), and the inner array is the set
86  // of immediate sub-Types (again as indices into _alltypes).
87  private int[][] make_minimal_graph() {
88 
89  int[][] subs = new int[_subtypes.length][];
90  for( int i=0; i<subs.length; i++ )
91  subs[i] = _subtypes[i].clone();
92 
93  // For all types
94  for( int i=0; i<subs.length; i++ ) {
95  int[] subis = subs[i];
96  // For all 'i' subtypes
97  for( int j=0; j<subis.length && subis[j] != -1; j++ ) {
98  int[] subjs = subs[subis[j]];
99  // Pull out of subis all things found in subjs. We have a subtype isa
100  // path from i->j by design of _subtypes, and the j->k list in subjs.
101  // Remove any i->k as being redundant.
102  int ix = j+1, ixx = j+1; // Index to read, index to keep non-dups
103  int jx = 0; // Index to read the k's
104  while( ix<subis.length && jx<subjs.length ) {
105  int six = subis[ix];
106  int sjx = subjs[jx];
107  assert sjx != -1;
108  if( six==-1 ) break; // Hit end-of-array sentinel
109  if( six==sjx ) { ix++; jx++; } // i->j and j->sjx and i->sjx, skip both forward
110  else if( six < sjx ) subis[ixx++] = subis[ix++]; // Keep and advance
111  else jx++; // Advance
112  }
113  while( ixx < ix ) subis[ixx++] = -1; // Sentinel remaining unused elements
114  }
115  int ix = Util.find(subs[i],-1);
116  if( ix != -1 ) subs[i] = Arrays.copyOfRange(subs[i],0,ix); // Compress extra elements
117  }
118 
119  return subs;
120  }
121 
122  private void push( long x ) {
123  if( _work_len == _work.length )
124  _work = Arrays.copyOf(_work,_work_len<<1);
125  _work[_work_len++] = x;
126  }
127 
128  private long pop() { return _work[--_work_len]; }
129 
130  // Print subtypes in RPO
131  private void print( int x, int d ) {
132  Type dt = get(x);
133  if( dt==null ) {
134  put(x,dt=TypeInt.con(d));
135  int[] subs = _min_subtypes[x];
136  for( int sub : subs )
137  print(sub,d+1);
138  System.out.println("#"+x+" = "+_alltypes[x]+" "+d+" "+dt.getl());
139  } else if( d < dt.getl() ) {
140  put(x,TypeInt.con(d));
141  System.out.println("Shrink #"+x+" = "+_alltypes[x]+" "+d+" "+dt.getl());
142  }
143  }
144 
145 
146  // Major test for monotonic behavior from value() calls. Required to prove
147  // correctness & linear-time speed from GCP & a major part of GVN.iter().
148  // (for GVN.iter(), ideal() calls ALSO have to be monotonic but using a
149  // different metric that is harder to test for).
150 
151  // How this works: for all Node.value() calls, for all input types, if the
152  // input type changes monotonically, so does the output type. Many input
153  // types are illegal for many Nodes, and can/should be asserted for by the
154  // Node. However, all legal inputs should produce an output with the
155  // monotonicity invariant.
156 
157  public static void main( String[] args ) { new TestNode().testMonotonic(); }
158  @SuppressWarnings("unchecked")
159  @Test public void testMonotonic() {
160  Env top = Env.top_scope();
161  Env.file_scope(top);
162  assert _errs == 0; // Start with no errors
163 
164  // Types we are testing
165  _alltypes = Type.ALL_TYPES().asAry();
166  // A subset used to help diagnose this algorithm.
167  //Type[] ts = new Type[] {
168  // Type.ALL,Type.ANY,Type.CTRL,Type.XCTRL, Type.SCALAR, Type.XSCALAR, Type.NSCALR, Type.XNSCALR,
169  // Type.NUM, Type.XNUM, Type.NIL
170  //};
171  //for( int i=0; i<ts.length; i++ )
172  // for( int j=i+1; j<ts.length; j++ )
173  // if( ts[j].isa(ts[i]) ) { Type tmp = ts[i]; ts[i] = ts[j]; ts[j] = tmp; }
174  //_alltypes = ts;
175 
176  // All The Types we care to reason about. There's an infinite number of
177  // Types, but mostly are extremely similar - so we limit ourselves to a
178  // subset which has at least one of unique subtype, plus some variations
179  // inside the more complex Types.
181 
182  // Build a minimal spanning sub-Type tree from the set of sample types.
183  // We'll use this to know which other types sub-Type this type... and thus be
184  // more efficient in testing all Types which subtype another Type.
186 
187  // Per-node-type cached value() results
188  _values = new NonBlockingHashMapLong<Type>(128*1024*1024,false);
189 
190  // Print the types and subtypes in a RPO
191  //print(0,0);
192  //_values.clear(true);
193 
194  // Setup to compute a value() call: we need a tiny chunk of Node graph with
195  // known inputs.
196  _gvn = Env.GVN;
197  _ins = new Node[4];
198  _ins[0] = new RegionNode(null,new ConNode<>(Type.CTRL),new ConNode<>(Type.CTRL));
199  for( int i=1; i<_ins.length; i++ )
200  _ins[i] = new ConNode<>(Type.SCALAR);
201  Node mem = new ConNode<Type>(TypeMem.MEM);
202  mem._val = TypeMem.MEM;
203  FunNode fun_forward_ref = new FunNode("some_fcn");
204  Env.DEFMEM._val = TypeMem.MEM;
205 
206  Node unr = top.lookup("+"); // All the "+" functions
207  FunNode fun_plus = ((FunPtrNode)unr.in(1)).fun();
208  RetNode ret = fun_plus.ret();
209  CallNode call = new CallNode(false,null,_ins[0],unr,mem);
210  call._val = TypeTuple.CALLE;
211  TypeStruct tname = TypeStruct.NAMEPT;
212 
213  // Testing 1 set of types into a value call.
214  // Comment out when not debugging.
215  CallEpiNode cepi = new CallEpiNode(call,Env.DEFMEM,_ins[2]);
217 
218  // All the Nodes, all Values, all Types
219  test1monotonic(new CallNode(false,null,_ins[0], unr ,mem,_ins[2],_ins[3]));
220  test1monotonic(new CallNode(false,null,_ins[0],_ins[1],mem,_ins[2],_ins[3]));
221  test1monotonic(new CallEpiNode(call,Env.DEFMEM,_ins[2])); // CallNode, then some count of RetNode, not flowing
225  // Cannot cast-to-NIL - can only move away from NIL
226  //test1monotonic(new CastNode(_ins[0],_ins[1],TypeInt.FALSE));
231  test1monotonic(new CProjNode(_ins[0],0));
232  test1monotonic(new ErrNode(_ins[0],null,"\nerr\n"));
233  test1monotonic(new FunNode(new String[]{"^","x"},new Type[]{TypeMemPtr.DISP_SIMPLE,TypeInt.INT64}));
234  test1monotonic(new FunPtrNode("anon",ret,null));
235  test1monotonic(new FP2DispNode(_ins[1])); // Only takes in a TFP
236  test1monotonic(new IfNode(_ins[0],_ins[1]));
239  test1monotonic(new IntrinsicNode(tname,null,null,mem,_ins[2]));
240  test1monotonic(new LoadNode(_ins[1],_ins[2],"x",null));
241  NewObjNode nnn1 = new NewObjNode(false,TypeMemPtr.DISPLAY,Node.con(Type.NIL));
242  set_type(1,Type.SCALAR); nnn1.create_active("x",_ins[1],Access.Final);
243  set_type(2,Type.SCALAR); nnn1.create_active("y",_ins[2],Access.Final);
244  test1monotonic(nnn1);
245  NewObjNode nnn2 = new NewObjNode(false,TypeMemPtr.DISPLAY,Node.con(Type.NIL));
246  set_type(1,Type.SCALAR); nnn2.create_active("x",_ins[1],Access.Final);
247  set_type(2,Type.SCALAR); nnn2.create_active("y",_ins[2],Access.Final);
248  nnn2.sets(tname);
249  test1monotonic(nnn2);
250  ((ConNode<Type>)_ins[1])._t = Type.SCALAR; // ParmNode reads this for _alltype
251  test1monotonic(new ParmNode( 1, "x",_ins[0],(ConNode)_ins[1],null).add_def(_ins[2]));
252  test1monotonic(new PhiNode(Type.SCALAR,null,_ins[0],_ins[1],_ins[2]));
253  for( PrimNode prim : PrimNode.PRIMS() )
254  test1monotonic_prim(prim,mem);
255  test1monotonic(new ProjNode(1, _ins[0]));
256  test1monotonic(new RegionNode(null,_ins[1],_ins[2]));
257  test1monotonic(new RetNode(_ins[0],mem,_ins[1],_ins[2],fun_plus)); // ctl,mem,val,rpc,fun
258  test1monotonic(new StoreNode(_ins[1],_ins[2],_ins[3],Access.RW ,"x",null));
259  test1monotonic(new StoreNode(_ins[1],_ins[2],_ins[3],Access.Final,"x",null));
260  // ScopeNode has no inputs, and value() call is monotonic
261  test1monotonic(new AssertNode(_ins[1],_ins[2],TypeInt.FALSE ,null, null));
262  test1monotonic(new AssertNode(_ins[1],_ins[2],TypeMemPtr.STRPTR,null, null));
263  test1monotonic(new AssertNode(_ins[1],_ins[2],TypeFlt.FLT64 ,null, null));
266 
267  assertEquals(0,_errs);
268  }
269 
270  @SuppressWarnings("unchecked")
271  private Type test1jig(final Node n, Type t0, Type t1, Type t2, Type t3) {
272  // Prep graph edges
273  _ins[0]._val = t0;
274  _ins[1]._val = ((ConNode)_ins[1])._t = t1;
275  _ins[2]._val = ((ConNode)_ins[2])._t = t2;
276  _ins[3]._val = ((ConNode)_ins[3])._t = t3;
277  return n.value(_gvn._opt_mode);
278  }
279 
280  private void test1monotonic(Node n) {
281  assert n._defs._len>0;
283  }
284 
285  // Fill a Node with {null,edge,edge} and start the search
286  private void test1monotonic_prim(PrimNode prim, Node mem) {
287  PrimNode n = (PrimNode)prim.copy(false);
288  assert n._defs._len==0;
289  n.add_def( null );
290  n.add_def(_ins[n._defs._len]);
291  if( n instanceof MemPrimNode ) n.add_def(mem);
292  if( n._sig.nargs() >= 3 ) n.add_def(_ins[n._defs._len-1]);
293  if( n._sig.nargs() >= 4 ) n.add_def(_ins[n._defs._len-1]);
295  }
296  // Fill a Node with {null,edge,edge} and start the search
298  NewNode.NewPrimNode n = (NewNode.NewPrimNode)prim.copy(false);
299  assert n._defs._len==0;
300  n.add_def( null );
301  n.add_def(_ins[1]); // memory
302  n.add_def(null); // display
303  n.add_def(_ins[2]); // arg#1
304  if( n._sig.nargs() >= 2 ) n.add_def(_ins[3]);
306  }
307 
308  @SuppressWarnings("unchecked")
309  private void test1monotonic_init(final Node n) {
310  System.out.println(n.xstr());
311  _values.clear(true);
312 
313  put(0,Type.ANY); // First args are all ANY, so is result
314  push(0); // Init worklist
315 
316  Type[] all = _alltypes;
317  long t0 = System.currentTimeMillis(), t2=t0;
318  long nprobes = 0, nprobes1=0;
319  while( _work_len > 0 ) {
320  long xx = pop();
321  Type vn = get_value_type(xx);
322  int x0 = xx(xx,0), x1 = xx(xx,1), x2 = xx(xx,2), x3 = xx(xx,3);
323  // Prep graph edges
324  _ins[0]._val = all[x0];
325  _ins[1]._val = ((ConNode)_ins[1])._t = all[x1];
326  _ins[2]._val = ((ConNode)_ins[2])._t = all[x2];
327  _ins[3]._val = ((ConNode)_ins[3])._t = all[x3];
328 
329  // Subtypes in 4 node input directions
330  int[] stx0 = stx(n,xx,0);
331  for( int y0 : stx0 )
332  set_value_type(n, vn, xx, xx(y0,x1,x2,x3), 0, y0, all );
333  set_type(0,all[x0]);
334 
335  int[] stx1 = stx(n,xx,1);
336  for( int y1 : stx1 )
337  set_value_type(n, vn, xx, xx(x0,y1,x2,x3), 1, y1, all );
338  set_type(1,all[x1]);
339 
340  int[] stx2 = stx(n,xx,2);
341  for( int y2 : stx2 )
342  set_value_type(n, vn, xx, xx(x0,x1,y2,x3), 2, y2, all );
343  set_type(2,all[x2]);
344 
345  int[] stx3 = stx(n,xx,3);
346  for( int y3 : stx3 )
347  set_value_type(n, vn, xx, xx(x0,x1,x2,y3), 3, y3, all );
348  set_type(3,all[x3]);
349 
350  nprobes1 += stx0.length+stx1.length+stx2.length+stx3.length;
351  long t1 = System.currentTimeMillis();
352  if( t1-t0 >= 1000 ) {
353  nprobes += nprobes1;
354  System.out.println("Did "+nprobes1+" in "+(t1-t0)+"msecs, worklist has "+_work_len+" states, total probes "+nprobes+", values="+_values.size());
355  nprobes1=0;
356  t0=t1;
357  }
358  }
359  nprobes += nprobes1;
360  System.out.println("Total probes "+nprobes+" in "+(t0-t2)+"msecs, values="+_values.size());
361  }
362 
363  private void set_value_type(Node n, Type vn, long xx, long xxx, int idx, int yx, Type[] all ) {
364  Type vm = get(xxx);
365  if( vm == null ) {
366  set_type(idx,all[yx]);
367  vm = n.value(_gvn._opt_mode);
368  Type old = put(xxx,vm);
369  assert old==null;
370  push(xxx); // Now visit all children
371  }
372  // The major monotonicity assert
373  int x1 = xx(xx,1);
374  int y1 = idx==1 ? yx : x1;
375  if( vn!= vm && !vn.isa(vm) ) {
376  int x0 = xx(xx,0), x2 = xx(xx,2), x3 = xx(xx,3);
377  System.out.println(n.xstr()+"("+all[x0]+","+all[x1]+","+all[x2]+","+all[x3]+") = "+vn);
378  System.out.println(n.xstr()+"("+all[idx==0?yx:x0]+","+all[idx==1?yx:x1]+","+all[idx==2?yx:x2]+","+all[idx==3?yx:x3]+") = "+vm);
379  _errs++;
380  redo_(n,idx, xx(xx,idx),yx,all);
381  }
382  }
383  // Stop in debugger and repeat as needed to debug
384  private void redo_(Node n, int idx, int xidx, int yx, Type[] all) {
385  set_type(idx,all[xidx]);
386  Type err_n = n.value(_gvn._opt_mode);
387 
388  set_type(idx,all[yx]);
389  Type err_m = n.value(_gvn._opt_mode);
390 
391  assert err_n.isa(err_m);
392  }
393 
394  @SuppressWarnings("unchecked")
395  private void set_type(int idx, Type tyx) {
396  if( idx > 0 ) ((ConNode)_ins[idx])._t = tyx;
397  _ins[idx]._val = tyx;
398  }
399 
400  private static final int[] stx_any = new int[]{};
401  private int[] stx(final Node n, long xx, int i) {
402  if( i >= n._defs._len || n.in(i) == null ) return stx_any;
403  return _min_subtypes[xx(xx,i)];
404  }
405 
406  // Get the value Type for 4 input types. Must exist.
407  private Type get_value_type(long xx) {
408  Type vt = get(xx);
409  assert vt!=null;
410  return vt;
411  }
412 
413  private static long xx( int i0, int i1, int i2, int i3 ) {
414  return i0+(i1<<8)+(i2<<16)+(i3<<24);
415  }
416  private static int xx(long xx, int i) { return (int)((xx>>(i<<3)) & 0xffL); }
417 }
com.cliffc.aa.node.TestNode.xx
static long xx(int i0, int i1, int i2, int i3)
Definition: TestNode.java:413
com.cliffc.aa.type.Type.NSCALR
static final Type NSCALR
Definition: Type.java:330
com.cliffc.aa.node.TestNode.make_minimal_graph
int[][] make_minimal_graph()
Definition: TestNode.java:87
com.cliffc.aa.type.TypeFld.Access.Final
Final
Definition: TypeFld.java:112
com.cliffc.aa.node.MemPrimNode
Definition: MemPrimNode.java:10
com.cliffc.aa.node.TestNode.test1monotonic_intrinsic
void test1monotonic_intrinsic(NewNode.NewPrimNode prim)
Definition: TestNode.java:297
com.cliffc.aa.node.TestNode.get_value_type
Type get_value_type(long xx)
Definition: TestNode.java:407
com.cliffc.aa.node.TestNode.redo_
void redo_(Node n, int idx, int xidx, int yx, Type[] all)
Definition: TestNode.java:384
com.cliffc.aa.node.PrimNode
Definition: PrimNode.java:20
com.cliffc.aa.type.Type.isa
boolean isa(Type t)
Definition: Type.java:623
com.cliffc.aa.util.Util.find
static int find(int[] es, int e)
Definition: Util.java:6
com.cliffc.aa.type.TypeMem
Memory type; the state of all of memory; memory edges order memory ops.
Definition: TypeMem.java:53
com.cliffc.aa.GVNGCM.Mode.PesiCG
PesiCG
Definition: GVNGCM.java:18
com.cliffc.aa.type.Type.SCALAR
static final Type SCALAR
Definition: Type.java:328
com.cliffc
com.cliffc.aa.node.TestNode.test1jig
Type test1jig(final Node n, Type t0, Type t1, Type t2, Type t3)
Definition: TestNode.java:271
com.cliffc.aa.Env.top_scope
static Env top_scope()
Definition: Env.java:72
com.cliffc.aa.node.IfNode
Definition: IfNode.java:9
com.cliffc.aa.type.TypeFld
Definition: TypeFld.java:12
com.cliffc.aa.node.Node
Definition: Node.java:16
com.cliffc.aa.util
Definition: AbstractEntry.java:1
com.cliffc.aa.type.TypeInt
Definition: TypeInt.java:9
com.cliffc.aa.node.TestNode.set_value_type
void set_value_type(Node n, Type vn, long xx, long xxx, int idx, int yx, Type[] all)
Definition: TestNode.java:363
com.cliffc.aa.node.FP2DispNode
Definition: FP2DispNode.java:7
com.cliffc.aa.type.Type
an implementation of language AA
Definition: Type.java:94
com.cliffc.aa.type.TypeFlt
Definition: TypeFlt.java:9
com.cliffc.aa.node.StoreNode
Definition: StoreNode.java:14
com.cliffc.aa.node.PhiNode
Definition: PhiNode.java:9
com.cliffc.aa.node.CProjNode
Definition: CProjNode.java:10
com.cliffc.aa.node.NewNode.NewPrimNode
Definition: NewNode.java:170
com.cliffc.aa.type.TypeTuple
Definition: TypeTuple.java:11
com.cliffc.aa.type.TypeFld.Access.RW
RW
Definition: TypeFld.java:111
com.cliffc.aa.type.TypeInt.con
static TypeInt con(long con)
Definition: TypeInt.java:37
com.cliffc.aa.node.TestNode.xx
static int xx(long xx, int i)
Definition: TestNode.java:416
com.cliffc.aa.node.NewNode.copy
NewNode copy(boolean copy_edges)
Definition: NewNode.java:143
com.cliffc.aa.node.Node._val
Type _val
Definition: Node.java:88
com.cliffc.aa.node.LoadNode
Definition: LoadNode.java:13
com.cliffc.aa.type.Type.ANY
static final Type ANY
Definition: Type.java:325
com.cliffc.aa.node.TestNode._subtypes
int[][] _subtypes
Definition: TestNode.java:29
com.cliffc.aa.node.ConNode
Definition: ConNode.java:9
com.cliffc.aa.node.Node.add_def
Node add_def(Node n)
Definition: Node.java:152
com.cliffc.aa.node.FunPtrNode
Definition: FunPtrNode.java:40
com.cliffc.aa.node.RetNode
Definition: RetNode.java:19
com.cliffc.aa.type.TypeStruct
A memory-based collection of optionally named fields.
Definition: TypeStruct.java:50
com.cliffc.aa.node.TestNode.print
void print(int x, int d)
Definition: TestNode.java:131
com.cliffc.aa.node.CallNode
Definition: CallNode.java:86
com.cliffc.aa.GVNGCM.Mode.PesiNoCG
PesiNoCG
Definition: GVNGCM.java:16
com.cliffc.aa.Env.lookup
Node lookup(String name)
Definition: Env.java:186
com.cliffc.aa.type.Type.ALL_TYPES
static Ary< Type > ALL_TYPES
Definition: Type.java:650
com.cliffc.aa.node.AssertNode
Definition: AssertNode.java:18
com.cliffc.aa.Env.GVN
static final GVNGCM GVN
Definition: Env.java:13
com.cliffc.aa.type.TypeInt.INT64
static final TypeInt INT64
Definition: TypeInt.java:39
com.cliffc.aa.type.TypeFunSig.nargs
int nargs()
Definition: TypeFunSig.java:87
com.cliffc.aa.type.TypeMemPtr.DISP_SIMPLE
static final TypeMemPtr DISP_SIMPLE
Definition: TypeMemPtr.java:105
com.cliffc.aa.type.TypeMemPtr.STR0
static final TypeMemPtr STR0
Definition: TypeMemPtr.java:98
com.cliffc.aa.node.TestNode.put
Type put(long h, Type t)
Definition: TestNode.java:46
com.cliffc.aa.node.Node.value
abstract Type value(GVNGCM.Mode opt_mode)
com.cliffc.aa.node.PrimNode._sig
final TypeFunSig _sig
Definition: PrimNode.java:22
com.cliffc.aa.node.NewNode.NewPrimNode.INTRINSICS
static final Ary< NewPrimNode > INTRINSICS
Definition: NewNode.java:186
com.cliffc.aa.type.TypeTuple.RET
static final TypeTuple RET
Definition: TypeTuple.java:130
com.cliffc.aa.type.TypeMemPtr.DISPLAY
static final TypeStruct DISPLAY
Definition: TypeMemPtr.java:78
com.cliffc.aa.node.PrimNode.PRIMS
static PrimNode[] PRIMS
Definition: PrimNode.java:36
com.cliffc.aa.node.ErrNode
Error nodes.
Definition: ErrNode.java:10
com.cliffc.aa.node.TestNode.test1monotonic
void test1monotonic(Node n)
Definition: TestNode.java:280
com.cliffc.aa.type.TypeStr.ABC
static final TypeStr ABC
Definition: TypeStr.java:47
com.cliffc.aa.util.Util
Definition: Util.java:5
com.cliffc.aa.type.Type.CTRL
static final Type CTRL
Definition: Type.java:326
com.cliffc.aa.node.TestNode.test1monotonic_prim
void test1monotonic_prim(PrimNode prim, Node mem)
Definition: TestNode.java:286
com.cliffc.aa.node.TestNode.test1monotonic_init
void test1monotonic_init(final Node n)
Definition: TestNode.java:309
com.cliffc.aa.node.Node.in
Node in(int i)
Definition: Node.java:126
com.cliffc.aa.node.TestNode._work_len
int _work_len
Definition: TestNode.java:50
com.cliffc.aa.node.TestNode.make_subtypes
int[][] make_subtypes()
Definition: TestNode.java:63
com.cliffc.aa.node.TestNode.push
void push(long x)
Definition: TestNode.java:122
com.cliffc.aa.node.TestNode.set_type
void set_type(int idx, Type tyx)
Definition: TestNode.java:395
com.cliffc.aa.GVNGCM
Definition: GVNGCM.java:12
com.cliffc.aa.Env.file_scope
static Env file_scope(Env top_scope)
Definition: Env.java:116
com.cliffc.aa.type.Type.simple_ptr
Type simple_ptr()
Definition: Type.java:358
com.cliffc.aa.node.TestNode.stx
int[] stx(final Node n, long xx, int i)
Definition: TestNode.java:401
com.cliffc.aa.type.TypeStr
Definition: TypeStr.java:14
com.cliffc.aa.node.NewNode.sets
final void sets(T ts)
Definition: NewNode.java:57
com.cliffc.aa.node.ProjNode
Definition: ProjNode.java:11
com.cliffc.aa.node.TestNode.testNode
void testNode()
Definition: TestNode.java:55
com.cliffc.aa.node.NewObjNode
Definition: NewObjNode.java:20
com.cliffc.aa.type.Type.NIL
static final Type NIL
Definition: Type.java:332
com.cliffc.aa.node.Node.con
static Node con(Type t)
Definition: Node.java:670
com.cliffc.aa.node.TestNode._min_subtypes
int[][] _min_subtypes
Definition: TestNode.java:36
com.cliffc.aa
Definition: AA.java:1
com.cliffc.aa.node.UnresolvedNode
Definition: UnresolvedNode.java:13
com.cliffc.aa.node.Node.xstr
String xstr()
Definition: Node.java:282
com.cliffc.aa.node.TestNode
Definition: TestNode.java:16
com.cliffc.aa.node.NewNode
Definition: NewNode.java:17
com.cliffc.aa.node.CastNode
Definition: CastNode.java:11
com.cliffc.aa.node.TestNode.testMonotonic
void testMonotonic()
Definition: TestNode.java:159
com.cliffc.aa.node.TestNode._ins
Node[] _ins
Definition: TestNode.java:19
com.cliffc.aa.node.Node.copy
Node copy(boolean copy_edges)
Definition: Node.java:264
com.cliffc.aa.type.TypeInt.FALSE
static final Type FALSE
Definition: TypeInt.java:45
com.cliffc.aa.type.TypeTuple.CALLE
static final TypeTuple CALLE
Definition: TypeTuple.java:131
com.cliffc.aa.node.CallEpiNode
Definition: CallEpiNode.java:24
com.cliffc.aa.node.ParmNode
Definition: ParmNode.java:14
com.cliffc.aa.util.NonBlockingHashMapLong
A lock-free alternate implementation of java.util.concurrent.ConcurrentHashMap with primitive long ke...
Definition: NonBlockingHashMapLong.java:91
com.cliffc.aa.node.NewObjNode.create_active
void create_active(String name, Node val, Access mutable)
Definition: NewObjNode.java:57
com.cliffc.aa.GVNGCM._opt_mode
Mode _opt_mode
Definition: GVNGCM.java:22
com.cliffc.aa.node.TestNode.hash
static long hash(long h)
Definition: TestNode.java:39
com.cliffc.aa.node.IntrinsicNode
Definition: IntrinsicNode.java:15
com.cliffc.aa.type.TypeFld.Access
Definition: TypeFld.java:109
com.cliffc.aa.type.TypeMemPtr.STRPTR
static final TypeMemPtr STRPTR
Definition: TypeMemPtr.java:97
com.cliffc.aa.node.TestNode.stx_any
static final int[] stx_any
Definition: TestNode.java:400
com.cliffc.aa.node.FunNode
Definition: FunNode.java:58
com.cliffc.aa.type.Type.getl
long getl()
Definition: Type.java:802
com.cliffc.aa.type.TypeStruct.NAMEPT
static final TypeStruct NAMEPT
Definition: TypeStruct.java:232
com.cliffc.aa.node.RegionNode
Definition: RegionNode.java:11
com
com.cliffc.aa.node.TestNode._alltypes
Type[] _alltypes
Definition: TestNode.java:24
com.cliffc.aa.type.TypeMem.MEM
static final TypeMem MEM
Definition: TypeMem.java:224
com.cliffc.aa.node.TestNode.main
static void main(String[] args)
Definition: TestNode.java:157
com.cliffc.aa.node.TestNode._gvn
GVNGCM _gvn
Definition: TestNode.java:21
com.cliffc.aa.Env.DEFMEM
static DefMemNode DEFMEM
Definition: Env.java:19
com.cliffc.aa.Env
Definition: Env.java:12
com.cliffc.aa.GVNGCM.Mode.Parse
Parse
Definition: GVNGCM.java:15
com.cliffc.aa.node.TestNode.pop
long pop()
Definition: TestNode.java:128
com.cliffc.aa.type
Definition: Bits.java:1
com.cliffc.aa.node.TestNode._work
long[] _work
Definition: TestNode.java:49
com.cliffc.aa.node.Node._defs
Ary< Node > _defs
Definition: Node.java:124
com.cliffc.aa.type.TypeMemPtr
Definition: TypeMemPtr.java:14
com.cliffc.aa.node.FunNode.ret
RetNode ret()
Definition: FunNode.java:900
com.cliffc.aa.type.TypeFlt.FLT64
static final TypeFlt FLT64
Definition: TypeFlt.java:38
com.cliffc.aa.GVNGCM.Mode
Definition: GVNGCM.java:14
com.cliffc.aa.node.TestNode._values
NonBlockingHashMapLong< Type > _values
Definition: TestNode.java:38
com.cliffc.aa.node.TestNode._errs
int _errs
Definition: TestNode.java:52
com.cliffc.aa.type.TypeTuple.TEST0
static final TypeTuple TEST0
Definition: TypeTuple.java:132