Jim Wilson wrote:
> It looks like a slight lose on qdf24xx on SPEC CPU2006 at -O3.  I see
> about a 0.37% loss on the integer benchmarks, and no significant
> change on the FP benchmarks.  The integer loss is mainly due to
> 458.sjeng which drops 2%.  We had tried various values for
> max_case_values earlier, and didn't see any performance improvement
> from setting it, so we are using the default value.

That's interesting as sjeng shows ~2% gain on Cortex-A72 due to the
hot switches being badly laid out... I wonder whether the loss you see is
due to code alignment or some other secondary effect.

> We've been tracking changes to the FSF tree, and adjust our tuning
> structure as necessary, so I'm not too concerned about this.  We will
> just set the max_case_values field in the tuning structure to get the
> result we want.  What I am slightly concerned about is that the
> max_case_values field is only used at -O3 and above which limits the
> usefulness.  If a port has specified a value, it probably should be
> used for all non-size optimization, which means we should check for
> optimize_size first, then check for a cpu specific value, then use the
> default.  If you do that, then you don't need to change the default to
> get better generic/a53 code, you can change it in the generic and/or
> a53 tuning tables.

Yes it would be better to ensure max_case_values is used at -O2 as well.
But even then you'd want a reasonable default so that you only need to
set it if you want something very different.

> Though I see that the original patch from Samsung that added the
> max_case_values field has the -O3 check, so there was apparently some
> reason why they wanted it to work that way.  The value that the
> exynos-m1 is using, 48, looks pretty large, so maybe they thought that
> the code size expansion from that is only OK at -O3 and above.  Worst
> case, we might need two max_case_value fields, one to use at -O1/-O2,
> and one to use at -O3.

I hope we can improve switch expansion in GCC7 to avoid the worst of the
issues, and then we can revisit these settings.

Wilco

Reply via email to