RFR(S): 8168283: adlc: fix error expanding expanded nodes.
Vladimir Kozlov
vladimir.kozlov at oracle.com
Wed Oct 19 22:26:08 UTC 2016
Should we use next ?
if (num_opnds() > %d) {\n", node->num_unique_opnds());
instead of
+ fprintf(fp, " // Remove duplicated operands and inputs which use
the same name.\n");
+ fprintf(fp, " if (num_opnds() == %d) {\n", cur_num_opnds);
Otherwise seems good.
Thanks,
Vladimir
On 10/19/16 7:44 AM, Lindenmaier, Goetz wrote:
> Hi,
>
> This fixes a small error in the expand methods usually generated from expand rules by adlc.
>
> Actually all nodes get an expand method generated, as it's used to finish construction of nodes after the matcher generated them. E.g., temp nodes are added in the expand.
>
> The error occurs for a 'real' expand generating several sub nodes. The 'real' expand rule calls expand of the newly generated nodes, let's call it sub-expand.
>
> Unfortunately the matcher sometimes generates superfluous operands that are removed in the expand methods. The 'real' expand generating sub-nodes does not generate these superfluous operands, therefore running the sub-expand crashes when it tries to remove these.
>
> This change adds a simple check in the sub-expand to avoid this crash. Also it adds setting the correct number of operands in the expand that generates the sub node.
>
> An example of an adl instruct declaration and the generated code is attached to the bug. We see this in a rule for the s390 port.
>
> http://cr.openjdk.java.net/~goetz/wr16/8168283-adlc_expand/webrev.01/
> https://bugs.openjdk.java.net/browse/JDK-8168283
>
> Please review this change. I please need a sponsor.
>
> Best regards,
> Goetz.
>
More information about the hotspot-compiler-dev
mailing list