MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / build

Method build

chapter23/src/main/java/com/seaofnodes/simple/codegen/IFG.java:67–85  ·  view source on GitHub ↗
( int round, RegAlloc alloc )

Source from the content-addressed store, hash-verified

65 // - At block head, "push" the new live-out to prior blocks.
66 // - - If they pick up new live-outs, put them on the worklist.
67
68 public static boolean build( int round, RegAlloc alloc ) {
69 // Reset all to empty
70 resetBBLiveOut();
71 resetIFG();
72
73 // Last block has nothing live out
74 assert WORK.isEmpty();
75 for( CFGNode bb : alloc._code._cfg )
76 if( bb.blockHead())
77 WORK.push( bb );
78
79 // Process blocks until no more changes
80 while( !WORK.isEmpty() )
81 do_block(round,alloc,WORK.pop());
82
83 if( alloc.success() )
84 convert2DAdjacency(alloc);
85 return alloc.success();
86 }
87
88 // Walk one block backwards, compute live-in from live-out, and build IFG

Callers 1

graphColorMethod · 0.95

Calls 9

resetBBLiveOutMethod · 0.95
resetIFGMethod · 0.95
do_blockMethod · 0.95
convert2DAdjacencyMethod · 0.95
isEmptyMethod · 0.45
blockHeadMethod · 0.45
pushMethod · 0.45
popMethod · 0.45
successMethod · 0.45

Tested by

no test coverage detected