RFR: 8332442: C2: refactor Mod cases in Compile::final_graph_reshaping_main_switch() [v3]

Kangcheng Xu kxu at openjdk.org
Tue Sep 10 15:57:24 UTC 2024


On Tue, 10 Sep 2024 14:54:13 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> I would end up with some linker error:
>> 
>> /usr/bin/ld: /path/to/jdk/build/linux-x86_64-server-fastdebug/hotspot/variant-server/libjvm/objs/divnode.o: in function `DivModNode::DivModNode(Node*, Node*, Node*)':
>> /path/to/jdk/src/hotspot/share/opto/divnode.cpp:1357:(.text+0x7e99): undefined reference to `vtable for DivModNode'
>> 
>> 
>> It looks like all nodes (even those abstract ones like `Multi` and `Op_Multi`) is processed with `macro` and added to the enum. I don't know why but it looks intentional.
>
> I think that's because `DivModNode` has a virtual method `Opcode()` that's defined by `macro`. Removing the `Op_DivMod` line removes the virtual method definition but the declaration is still there. So removing `Op_DivMod` requires removing the `Opcode()` declaration in the `DivModNode` class. Anyway, that can be cleaned up in a separate PR if needed.

Thanks for explaining. That is reasonable

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20877#discussion_r1752239134


More information about the hotspot-compiler-dev mailing list