Denis Chertykov schrieb:
> 2011/4/17 Denis Chertykov <cherty...@gmail.com>:
>> 2011/4/15 Georg-Johann Lay <a...@gjlay.de>:
>>> Finally, I exposed alternative #3 of the insns to the register
>>> allocator, because it is not possible to distinguish between
>>> overlapping or non-overlapping regs, and #3 does not need a scratch.
>>>
>>> Ran C-testsuite with no regressions.
>> Are you encountered any difference in code size ?
> 
> I'm ask about code size because the IRA pass isn't work with
> `scratch:MODE' at all.

I wonder what the difference is; IRA could treat scratch:MODE just the
same way as pseudo:MODE. Anyway, thanks for that insight. It's merely
impossible to get the big picture of IRA/reload from digging sources.

So that means IRA generates garbage for scratch and reload has to fix
it, generate spill code if needed, etc?

Does this mean that if IRA sees a pseudo together with constraint "X"
it will allocate the pseudo, anyway?

> This lead to bad/wrong register allocation in IRA pass.
> The reload pass will correct such a wrong allocation, but reload can't
> generate optimal code. (reload generate correct code).
> Because of that, may be you right and may be better to have
> (clobber (match_operand....)) instead of (clobber (match_scratch...)).

I don't see effects on code size, at least for the binaries left by
testsuite.

Is there a policy how to drive size-performance tests for avr?
Anatoly posted a result on code size some weeks ago (concerning move
costs), it would be interesting to know his setup and what
sources/options he uses. Using testsuite seems not appropriate to me,
because it runs -O3, -finline etc. and most code is no real-world
code, at least not for avr.

FYI, what I observe is a remarkable dependency on subreg lowering that
can be generalized as this:
* code size decreases for mode <= SImode
* code size increases for mode > SImode

An example for gcc.target/avr/torture/pr41885.c -Os

-fno-split-wide-types

00000000 00000008 T rotl_16a
00000008 00000006 T rotl_16b
00000014 00000012 T rotl_32a
00000026 00000010 T rotl_32b
00000036 00000006 T rotl_32c
00000042 00000010 T rotl_32d
00000052 00000010 T rotl_32e
00000062 00000088 T rotl_64
00000150 00000106 T rotl_64a
00000256 00000082 T rotl_64b
00000338 00000096 T rotl_64c
00000434 00000098 T rotl_64d
00000532 00000100 T rotl_64e
00000632 00000102 T rotl_64f
00000734 00000104 T rotl_64g
00000838 00000110 T rotl_64h

-fsplit-wide-types

00000000 00000008 T rotl_16a
00000008 00000006 T rotl_16b
00000014 00000024 T rotl_32a
00000038 00000020 T rotl_32b
00000058 00000024 T rotl_32c
00000082 00000022 T rotl_32d
00000104 00000022 T rotl_32e
00000126 00000036 T rotl_64
00000162 00000050 T rotl_64a
00000212 00000026 T rotl_64b
00000238 00000036 T rotl_64c
00000274 00000038 T rotl_64d
00000312 00000040 T rotl_64e
00000352 00000042 T rotl_64f
00000394 00000044 T rotl_64g
00000438 00000038 T rotl_64h

Johann

> 
> Denis.
> 

Reply via email to