Nodes removal from the IR

Juan Fumero juan.fumero at ed.ac.uk
Mon Aug 1 09:28:53 UTC 2016


Hi Lukas, 

  I didn't actually replace LoadFieldNode.  I was thinking I could
apply something similar to FixedGuard and replace it with null and then
remove it. 

So for these kind of nodes I should replace them with another node?
Could I replace it either with a FloatingNode or FixedNode?  

Thanks
Juan

On Mon, 2016-08-01 at 10:49 +0200, Lukas Stadler wrote:
> Hi Juan,
> 
> how do you remove the LoadFieldNode?
> replaceAtUsages(null) is a problem in this case, because this node is
> supposed to generate a value.
> Do you replace it with a constant?
> 
> - Lukas
> 
> > 
> > On 29 Jul 2016, at 12:00, Juan Fumero <juan.fumero at ed.ac.uk> wrote:
> > 
> > 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@
> > 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