Hi,
On 10/30/25 10:49, Martin Jambor wrote:
+
+ /* If the decl in the call stmt doesn't match, the edge has been
redirected
+ and thus is useful. */
+ if (e->call_stmt)
+ {
+ tree call_stmt_decl
+ = TREE_OPERAND (gimple_call_arg (e->call_stmt, e->callback_id), 0);
+ if (DECL_UID (call_stmt_decl) != DECL_UID (e->callee->decl))
+ return true;
+ }
But I don't understand this one. First, with LTO the check for
e->call_stmt non-NULL-ness will always fail as the function is only
called from IPA-CP WPA phase and so statements will not be in memory.
So we need a better check, whatever this tries to check for. But I
don't see what non-cloning and non-ICF case you are after here. What is
the testcase where this triggers?
The function essentially tests whether an edge has been redirected or
not. This part is primarily meant as a fail safe in case the checks for
cloning and ICF weren't exhaustive, motivated by me missing ICF
redirections in the original version of this function. If this list is
exhaustive, then I suppose this check can be done away with.
The check for statement non-nullness with go through when not compiling
with LTO (enabled by this series). I am aware that this branch is
useless when using LTO, but it's the best thing I could come up with. I
don't think there is a testcase that triggers it, though ICF
redirections also slipped through, because the LTO requirement was just
too restrictive on the testsuite. I suppose this might be a bit
overcompensating.
Sorry for the delay in replying. I tried to figure out what I'm missing
here but have not managed.
No worries. :)
Thanks,
Martin
Best regards,
Josef