> Hi, Hi, I was thinking of not offlining functions with total count 0, too. I think one still needs to do it. Imagine that we have
instance 1 a with b offline instance 2 a with b inline and total count 0. Now we merge instance 1 to instnace 2. If we won't offline b the profile will claim that b is not executed which may be fase in case instance 1 calls b often. We can save some effort by special casing total count of 0 and instead of producing offline b just remove the inline instance. > > annotate_cfg doesnt annotate it correctly in this case and causus ICE. There > is also no benefit in offlining this. > > For: > _ZL27shift_amt_for_vec_perm_mask12machine_modeRK16vec_perm_indices9optab_tag > total:0 head:-1 > > dump file: t.ii.091i.fnsummary > gcc/optabs.cc: In function 'rtx_def* > shift_amt_for_vec_perm_mask(machine_mode, const vec_perm_indices&, optab)': > gcc/optabs.cc:7863:1: internal compiler error: in to_sreal_scale, at > profile-count.cc:352 > 0x3ca209f internal_error(char const*, ...) > ../../gcc/gcc/diagnostic-global-context.cc:517 > 0x3c5d5b3 fancy_abort(char const*, int, char const*) > ../../gcc/gcc/diagnostic.cc:1818 > 0x1e42a3f profile_count::to_sreal_scale(profile_count, bool*) const > ../../gcc/gcc/profile-count.cc:352 the assert here is that counts are not compatible which looks like scalig bug earlier. There is PR on that too. I will try to reproduce it - it is one of fallouts of the autofdo 0s not being 0s. It wouldhelp to know what the two counts are and where they were set. Honza > 0x1b84933 analyze_function_body > ../../gcc/gcc/ipa-fnsummary.cc:2941 > 0x1b86a13 compute_fn_summary(cgraph_node*, bool) > ../../gcc/gcc/ipa-fnsummary.cc:3491 > 0x1b8ab4f inline_analyze_function(cgraph_node*) > ../../gcc/gcc/ipa-fnsummary.cc:4630 > 0x1b8ad5f ipa_fn_summary_generate > ../../gcc/gcc/ipa-fnsummary.cc:4673 > 0x1df23cf execute_ipa_summary_passes(ipa_opt_pass_d*) > ../../gcc/gcc/passes.cc:2293 > 0x17b1e7f ipa_passes > ../../gcc/gcc/cgraphunit.cc:2253 > 0x17b2287 symbol_table::compile() > ../../gcc/gcc/cgraphunit.cc:2351 > 0x17b29fb symbol_table::finalize_compilation_unit() > ../../gcc/gcc/cgraphunit.cc:2607 > > gcc/ChangeLog: > > 2025-07-25 Kugan Vivekanandarajah <kvivekana...@nvidia.com> > > * auto-profile.cc (function_instance::offline): Dont offline > if inlined instance has 0 total count > > Thanks, > Kugan