On 11/19/25 1:32 AM, Richard Biener wrote:


Well.  I think it's OK to enable on a subset of targets by default,
but it should be target maintainers say whether a target is among the
crowd or not.  There's the target specific optimization_table as
mechanism to achieve such defaults, like

gcc/common/config/i386/i386-common.cc

static const struct default_options ix86_option_optimization_table[] =
   {
     /* Enable redundant extension instructions removal at -O2 and higher.
*/
     { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 },
     /* Enable function splitting at -O2 and higher.  */
     { OPT_LEVELS_2_PLUS, OPT_freorder_blocks_and_partition, NULL, 1 },
...

that's the canonical way to achieve a per-target default.

Iff there's an actual mechanism that a target can do individual
costing that might be also a way to signal support and we can
decide a default based on such implementation, but I don't see that
here so I suggest to go the above way.

I've seen no agreement to enable this on x86 btw.
I wouldn't be surprised if this turns out to be something we want to twiddle based on the tuning options rather than on/off by default at a target ISA level, so the override_options routine may be a better fit.

I know I was pushing for it to be enabled more widely as it's painfully hard to forward from a narrow store to a wider load. But based on earlier discussions I've backed off that position.

Or we could have a target hook indicating the cost of a narrow store followed by a wide load and base decisions off that.

jeff

Reply via email to