special handling for UnwindNode
Doug Simon
doug.simon at oracle.com
Fri Dec 6 02:00:17 PST 2013
On Dec 5, 2013, at 11:06 PM, Deneau, Tom <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
Yes, that’s the right thing to do.
> 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.
You can use unwindNode.replaceAtPredecessor() instead. And there’s no need to replace the usages of an unwind node since there are none.
-Doug
More information about the graal-dev
mailing list