This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Combine performance regression (was: Fix PR target/18701)

Roger Sayle wrote:

> The RTL "subreg:SI (mem:QI foo))" performs a QImode read from memory.
> The RTL "(mem:SI foo)" performs an SImode read from memory.  The mode
> used to access memory is the mode attached to the MEM.  Placing a
> SUBREG around a MEM access does not access memory outside of the
> object refered to by the MEM.

You sent this mail while I was composing the other mail I just sent ;-)
This is exactly what I meant to say, I just didn't express it so
succinctly ... 

> Placing a SUBREG around a MEM doesn't widden it.  Changing the
> mode of the MEM does.  You've diagnosed the problem correctly, but
> you've not correctly identified/disabled the errant transformation
> that was causing it.  In fact, I think the other fix for PR18701
> that you committed may have been the true cause and the correct fix.

Exactly.  You'll notice that due to the wrong isize,

      /* If we want to refer to something bigger than the original memref,
         generate a paradoxical subreg instead.  That will force a reload
         of the original memref X.  */
      if (isize < osize)
        return gen_rtx_SUBREG (omode, x, 0);

        offset = MAX (isize, UNITS_PER_WORD) - MAX (osize, UNITS_PER_WORD);

      /* Adjust the address so that the address-after-the-data is unchanged. */
        offset -= MIN (UNITS_PER_WORD, osize) - MIN (UNITS_PER_WORD, isize);

      return adjust_address_nv (x, omode, offset);

the function would fall through to adjust_address_nv using a omode
*bigger* that the original mode.  *Here* is where the broken widening
came from ...


  Dr. Ulrich Weigand
  Linux on zSeries Development

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]