Nodes removal from the IR
Lukas Stadler
lukas.stadler at oracle.com
Mon Aug 1 08:49:53 UTC 2016
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 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