https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92046

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 47014
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47014&action=edit
prototype

Something like this.  Note the behavior changes if the user manually specifies
any of the parameters.  We'd need to add a maybe_get_and_adjust_param_value
that gets the unaltered value if the user specified it.  But for that we'd
have to hard pass-in global_options and global_options_set (or hardcode it
in params.c).  But then the behavior between -O2 and -O2 --param
max-stores-to-sink=2 would be different (even though that's the documented
default of the
--param) - which is btw the current behavior.  We could check against the
default value but that means the behavior is different if targets change the
param and the behavior differs between --param X=default and X=default-1
(drastically in the case of dropping to zero).

I think for the vectorizer the only problematic case is
PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS, the others are documented to be
turned off.  Likewise max-stores-to-sink.  So I made
vect-maxversion-for-alias-checks adjusted relatively with
-fvect-cost-model=cheap so a global changed
--param still has an effect.

Reply via email to