This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Detect not-cloned new/delete operators in DCE.


On 8/6/19 7:02 PM, Martin Jambor wrote:
> 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...

Thank you Martin for answer. It can definitely wait once you're back
at the office.

> 
> 
> 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.

Hm, I can see neither of cgraph_node::clone_of and cgraph_node::former_clone_of set
for my ISRA clone:

grep clone /tmp/node
  next_sibling_clone = <cgraph_node * 0x0>, 
  prev_sibling_clone = <cgraph_node * 0x0>, 
  clones = <cgraph_node * 0x0>, 
  clone_of = <cgraph_node * 0x0>, 
  former_clone_of = <tree 0x0>, 
  simdclone = 0x0, 
  simd_clones = <cgraph_node * 0x0>, 
  clone = {
  tm_clone = 0, 

Anyway, I'm planning to use DECL_ABSTRACT_ORIGIN here.

Martin

> 
> Martin
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]