On Thu, Mar 18, 2021 at 09:31:03AM -0600, Jeff Law wrote: > > > OK. But it'd sure be nice to be able to do something like force a value > > > of > > > MOVE_MAX using a --param to make this kind of hack unnecessary. > > I fear such a param would be quite dangerous, dunno what would happen if > > somebody chose a length that can't be backed up by some integral or SIMD > > type. Maybe for the gimple-fold.c case > > tree type = lang_hooks.types.type_for_size (ilen * 8, 1); > > if (type > > && is_a <scalar_int_mode> (TYPE_MODE (type), &mode) > > && GET_MODE_SIZE (mode) * BITS_PER_UNIT == ilen * 8 > > would fail (so we couldn't handle that way the 16 byte case anyway on all > > targets), but there are other parts of the compiler that use MOVE_MAX. > > > > I think maybe better would be to instead improve the optimization so that > > it would work even with the non-lowered memcpy calls. But that would be > > a GCC12 thing probably. > > In my mind it'd only be for the testsuite and would be documented as such. > I wouldn't want users twiddling it. We could do the same with BRANCH_COST
For BRANCH_COST we already have -mbranch-cost= option on a couple of targets and then --param=logical-op-non-short-circuit={0,1} to override the gimplification behavior. Jakub