On Mon, Sep 3, 2018 at 12:02 PM Martin Jambor <mjam...@suse.cz> wrote: > > Hi, > > On Fri, Aug 31 2018, Michael Ploujnikov wrote: > > I've done some more digging into the current uses of > > numbered_clone_function_name and checked if any tests fail if I change > > it to suffixed_function_name: > > > > - gcc/cgraphclones.c: DECL_NAME (new_decl) = > > numbered_clone_function_name (thunk->decl, "artificial_thunk"); > > - no new tests fail, inconclusive > > - and despite the comment on redirect_callee_duplicating_thunks > > about "one or more" duplicates it doesn't seem like > > duplicate_thunk_for_node would be called more than once for each > > node, assuming each node is named uniquely, but I'm far from an > > expert in this area > > The comment means that if there is a chain of thunks, the method clones > all of them. Nevertheless, you need name numbering here for the same > reason why you need them for constprop.
The remaining question I had with the patch was if maybe all callers can handle assigning the numbering themselves, thus do sth like for-each-clone-of (i, fn) DECL_NAME (...) = numbered_clone_function_name (..., "artificial_thunk", i); which would make the map of name -> number unnecessary. > > > - gcc/omp-expand.c: DECL_NAME (kern_fndecl) = > > numbered_clone_function_name (kern_fndecl, "kernel"); > > - no new tests fail, inconclusive > > - I didn't see (and couldn't figure out a way to get) any of the > > existing omp/acc tests actually exercise this codeptah > > I guess this one should not need it. Build with > --enable-offload-targets=hsa and run gomp.exp to try yourself. I can > run run-time HSA tests for you if you want. > > Martin