Hi,

unfortunately I cannot look into the problem now and I don't have my
phone set up to review patches in a sane way, but to answer your
question below...


On Tue, Aug 06 2019, Martin Liška wrote:
> On 8/6/19 2:42 PM, Martin Liška wrote:

...

>> Hm, strange that the ISRA clones don't have n->clone_of set. It's created 
>> here:
>> 
...

>> 
>> @Martin, @Honza: Why do we not set clone_of in this transformation?
>
...node->clone_of is set only while a clone created in the true IPA
stages has no body on its own and shares the body with the
original. These clones form a tree and their clone_of is cleared when
they get a body.  IPA-SRA is not a true IPA pass and the clones it
creates are created with create_clone_with_body (or similarly named)
method which immediately gives them a body, so setting clone_of would be
wrong. (The new IPA-SRA is a true IPA pass and so its clones have phase
when their clone_of is set).

When an IPA-stage clone gets its body (when it is materialized),
node->former_clone_of gets set to the decl (as opposed to cgraph_node)
of the original node and hopefully create_clone_with_body sets it
too. Can you perhaps use that?

> If I'm correct cgraph_node::clone is used for inline clones only?
>

IPA-CP also creates clones, it does so by calling
cgraph_node::create_virtual_clone but that also sets clone_of.

Martin

Reply via email to