RFR: 8338971: IGV: Add incrementally inlined method name to phase name
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Tue Sep 3 13:30:23 UTC 2024
On Tue, 3 Sep 2024 11:43:57 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> This patch adds the method name to the incremental inlining step dumps in IGV which improves debugging issues involving incremental inlining:
>
>
> static void test() {
> method1();
> method2();
> method3();
> }
>
> static void method1() {}
> static void method2() {}
> static void method3() {}
>
> Run with `-XX:+AlwaysIncrementalInline` and IGV print level >=3:
>
> Before patch:
> ![image](https://github.com/user-attachments/assets/a3a1ab32-e7b3-4ccb-8ab2-a75d2b5b6912)
>
> After patch:
> ![image](https://github.com/user-attachments/assets/8100a2fe-1670-4687-b8b8-c8053fbaa7d7)
>
> The patch just prints the method name if we call `print_method()` with `n` being a call node which, AFAICT, only happens for the incremental inlining step. However, even if we call it with another phase at some point, I don't think it hurts to also dump the method name there.
>
> #### Testing
> - Manually verifying change in IGV
> - Building IGV which runs its unit tests
> - Sanity run with a hello world program with `-Xcomp -XX:+AlwaysIncrementalInline -XX:+PrintIdealGraph -XX:PrintIdealGraphLevel=3 -XX:PrintIdealGraphFile=graph.xml`
>
> Thanks,
> Christian
Looks good otherwise!
src/hotspot/share/opto/compile.cpp line 5206:
> 5204: call->method()->print_short_name(&ss);
> 5205: }
> 5206: }
Suggestion: using `call->_name` instead of `call->method()->print_short_name()` is slightly simpler and more general (should be equivalent for incremental inlining, but will also print stub names, "uncommon trap", etc. when dumping `PHASE_AFTER_ITER_GVN_STEP` graphs on call nodes).
Suggestion:
ss.print(": %d %s", n->_idx, NodeClassNames[n->Opcode()]);
if (n->is_Call()) {
CallNode* call = n->as_Call();
if (call->_name != nullptr) {
ss.print(" - %s", call->_name);
}
}
-------------
Marked as reviewed by rcastanedalo (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/20834#pullrequestreview-2277443616
PR Review Comment: https://git.openjdk.org/jdk/pull/20834#discussion_r1742063501
More information about the hotspot-compiler-dev
mailing list