Nodes removal from the IR

Juan Fumero juan.fumero at ed.ac.uk
Fri Jul 29 10:00:20 UTC 2016


Hi all, 
  I am trying to remove some nodes from the IR that I do not need for
the GPU execution. 

For instance, to remove some of the FixedGuard I do the following:

<code>
if (node instanceof FixedGuardNode) {
   node.replaceAtUsages(null);
   graph.removeFixed((FixedWithNextNode));
}
        
new CanonicalizerPhase().apply(graph, new PhaseContext(providers));
new DeadCodeEliminationPhase().apply(graph);
</code>

This works fine. However, when I try to remove other kind of nodes,
like UnsafeLoadNode, I get the following error:

[thread:1] scope: main
  [thread:1] scope: main.CleanPhase
    [thread:1] scope: main.CleanPhase.InterceptException
    Exception occurred in scope: main.CleanPhase.InterceptException
    Context obj com.oracle.graal.graph.VerificationError: cannot delete
node 74|UnsafeLoad because of predecessor: 72|LoadField#locals
    	at node: 74|UnsafeLoad
    Context obj com.oracle.truffle.r.library.gpu.phases.CleanPhase at 32dd
cca
internal error: com.oracle.truffle.r.runtime.RInternalError:
com.oracle.graal.graph.VerificationError: cannot delete node
74|UnsafeLoad because of predecessor: 72|LoadField#locals
	at node: 74|UnsafeLoad (see fastr_errors.log)


Because there is a dependency with LoadFieldNode. My question is, how
could I get rid of these kind of nodes? I am trying also to remove its
dependencies but I get the same error. I also tried to removed with
graph.removeFixed(node) but I get the error as well. 


Many thanks
Juan


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the graal-dev mailing list