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

--- Comment #8 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
analyzing the different thumb1/2 reload dumps,
I see t2 often uses code like that to access spill slots:

(insn 11576 8090 9941 5 (set (reg:SI 3 r3 [11890])
        (plus:SI (reg/f:SI 13 sp)
            (const_int 480 [0x1e0]))) sha512.c:147 4 {*arm_addsi3}
     (nil))
(insn 9941 11576 2978 5 (set (reg:DI 2 r2 [4210])
        (mem/c:DI (reg:SI 3 r3 [11890]) [5 %sfpD.4158+-3112 S8 A64]))
sha512.c:147 170 {*arm_movdi}
     (nil))

while t1 often does it this way:

(insn 8221 8219 4591 6 (set (reg/v:DI 4 r4 [orig:1450 fD.4102 ] [1450])
        (mem/c:DI (plus:SI (reg/f:SI 13 sp)
                (const_int 152 [0x98])) [5 %sfpD.4164+-1432 S8 A64]))
sha512.c:155 748 {*thumb1_movdi_insn}
     (nil))


grep "plus.*reg.*sp" t1/sha512.c.260r.reload |grep -v mem |wc -l
110

grep "plus.*reg.*sp" t2/sha512.c.260r.reload |grep -v mem |wc -l
602


I think in thumb1 the 110 memory accesses are all for frame-objects,
like X, a-h, etc, while thumb2 also uses pointers to access spill slots.

It must be pretty expensive for thumb1 to access something using
a pointer register.  But for thumb2 it this strategy creates rather
significant register pressure.

Reply via email to