Hi,

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

Attachment: 0001-AutoFDO-Dont-offline-if-inlined-instance-has-0-total.patch
Description: 0001-AutoFDO-Dont-offline-if-inlined-instance-has-0-total.patch

Reply via email to