Re: [PATCH v3] Consider frequency in cost estimation when converting scalar to vector.

2025-05-14 Thread Jan Hubicka
> Thansk for review. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ok for trunk? > > 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

[PATCH v3] Consider frequency in cost estimation when converting scalar to vector.

2025-05-13 Thread liuhongt
Update in V3 > > > +  cost_sse_integer = 0; > > > +  weighted_cost_sse_integer = 0 ; > Extra space here. Changed. > > > +       : ix86_size_cost.sse_to_integer; > > Please be sure to not revert the changes from my patch adding >   COSTS_N_INSNS (...) / 2 > here and some other places. Yes, keep the

Re: [PATCH v3] Consider frequency in cost estimation when converting scalar to vector.

2025-05-12 Thread Jan Hubicka
> > gcc/ChangeLog: > > > > * config/i386/i386-features.cc > > (scalar_chain::mark_dual_mode_def): Weight > > n_integer_to_sse/n_sse_to_integer with bb frequency. > > (general_scalar_chain::compute_convert_gain): Ditto, and > > adjust function prototype to ret

Re: [PATCH v3] Consider frequency in cost estimation when converting scalar to vector.

2025-05-11 Thread Hongtao Liu
On Thu, May 8, 2025 at 2:40 PM liuhongt wrote: > > The only part I changed is related to size_cost of sse_to_ineteger, as below > > 114+ /* Under TARGET_SSE4_1, it's vmovd + vpextrd/vpinsrd. > 115+ W/o it, it's movd + psrlq/unpckldq + movd. */ > 116+ else if (!TARGET_64BIT && smode != SImod

[PATCH v3] Consider frequency in cost estimation when converting scalar to vector.

2025-05-08 Thread liuhongt
The only part I changed is related to size_cost of sse_to_ineteger, as below 114+ /* Under TARGET_SSE4_1, it's vmovd + vpextrd/vpinsrd. 115+ W/o it, it's movd + psrlq/unpckldq + movd. */ 116+ else if (!TARGET_64BIT && smode != SImode) 117+cost *= TARGET_SSE4_1 ? 2 : 3; 118+ Ok for trun