special handling for UnwindNode

Gilles Duboscq duboscq at ssw.jku.at
Fri Dec 6 01:59:18 PST 2013


Hello Tom,

You should be able to use the lowering solution.
Since it is a control sink node you can indeed not use
replaceFixedWithFixed.
However you can still replace such a node using something like what the
canonicalizer does in this case:

fixed.predecessor().replaceFirstSuccessor(fixed, canonical);
GraphUtil.killCFG(fixed);

where fixed is the "old" node (in your case the UnwindNode) and canonical
is the "new" node (HSAILUnwindNode).
Let us know if that work. In particular I'd be interested to know if you
don't hit any corner case in the LoweringPhase when lowering control sink
nodes.

An other solution would be that we change the base unwind node. But the
lowering solution doesn't seem that dirty to me.

-Gilles


On Thu, Dec 5, 2013 at 11:06 PM, Tom Deneau <tom.deneau at amd.com> wrote:

> Hi --
>
> For the hsail backend, we wanted to do some special handling for
> UnwindNode.
>
> The current UnwindNode has
>
>     @Override
>     public void generate(LIRGeneratorTool gen) {
>         gen.emitUnwind(gen.operand(exception()));
>     }
>
> So the LIRGenerators then have
>
>     @Override
>     public void emitUnwind(Value exception) {
>
> In our hsail handling, we would like to have access to the original
> exception ValueNode rather than the Value.  (I don't really know, can one
> get back to the ValueNode given the Value?)
>
> As a dirty solution, we could stick some special handling in UnwindNode
> but for the long run I was thinking of how to do this without changing any
> of the base classes.
>
> I thought in the lowering stage we could replace UnwindNode with our own
> HSAILUnwindNode with its own generate routine that did something like
>     @Override
>     public void generate(LIRGeneratorTool gen) {
>         gen.emitUnwind(exception());
>     }
>
> but saw that graph.replaceFixedWithFixed could not be used in this case
> because UnwindNode is not a FixedWithNextNode.
>
> Any other suggestions of how this could be done without changing the base
> classes?
>
> -- Tom
>
>
>
>


More information about the graal-dev mailing list