[RFC] Handle memset in DSE (take 2)

Richard Sandiford rdsandiford@googlemail.com
Thu Jan 8 00:45:00 GMT 2009

Paolo Bonzini <bonzini@gnu.org> writes:
> Jakub Jelinek wrote:
>> On Wed, Jan 07, 2009 at 08:41:45AM +0100, Paolo Bonzini wrote:
>>>> I'd much rather have an rtx object that explicitly gave the
>>>> number of repetitions, and that could itself have BLKmode.
>>>> Thinking about it, we don't need to make the object constant
>>>> either, despite what I said before.  How about:
>>>>     (repeat:BLK value count)
>>>> where VALUE and COUNT are rtxes.  If we want to support non-byte
>>>> repeats, we could add a third length operand, to cope with the
>>>> VOIDness of CONST_INT values.
>> True, but I'm not sure we should introduce it now for 4.4, there
>> are risks that we don't handle this new RTL code in all the routines
>> where it has to be handled.
>> No backend in the current trunk uses (set (mem:BLK [SNNN]) (const_int M))
>> for M != 0, so ATM only the repeated zero is present in the RTL in between
>> the passes, it currently is only present inside of DSE in DSE's structures for
>> memset (&a, 2, sizeof a), never in the bb's.

Ah, sorry, I hadn't realised the non-zero constants were guaranteed
to be local to DSE.  In that case, I agree it isn't as dangerous
for 4.4 as I'd feared.

>> For 4.5 I agree that REPEAT or something similar makes a lot of sense.

Thanks.  Sounds like a plan then: keep it as-is for 4.4, but add a new
rtx code for 4.5.

> Well, I interpreted Richard's suggestion as 4.5 material only, since
> your patch was already committed 3 weeks ago anyway.

Yeah, sorry, that was just me being behind and not having had much time
for gcc stuff recently.  I was actually thinking of 4.4 due to the
above misunderstanding.


More information about the Gcc-patches mailing list