https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120215
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <liuho...@gcc.gnu.org>: https://gcc.gnu.org/g:f0d36c822c8b0918583c6bc3b1db01f2bb7f226b commit r16-619-gf0d36c822c8b0918583c6bc3b1db01f2bb7f226b Author: liuhongt <hongtao....@intel.com> Date: Tue Dec 17 22:32:31 2024 -0800 Consider frequency in cost estimation when converting scalar to vector. n some benchmark, I notice stv failed due to cost unprofitable, but the igain is inside the loop, but sse<->integer conversion is outside the loop, current cost model doesn't consider the frequency of those gain/cost. The patch weights those cost with frequency. gcc/ChangeLog: PR target/120215 * config/i386/i386-features.cc (scalar_chain::mark_dual_mode_def): Weight cost of integer<->sse move with bb frequency when it's optimized_for_speed_p. (general_scalar_chain::compute_convert_gain): Ditto, and adjust function prototype to return true/false when cost model is profitable or not. (timode_scalar_chain::compute_convert_gain): Ditto. (convert_scalars_to_vector): Adjust after the upper two function prototype are changed. * config/i386/i386-features.h (class scalar_chain): Change n_integer_to_sse/n_sse_to_integer to cost_sse_integer, and add weighted_cost_sse_integer. (class general_scalar_chain): Adjust prototype to return bool intead of int. (class timode_scalar_chain): Ditto.