This is the mail archive of the gcc-patches@gcc.gnu.org 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: Performance regression


On Sunday, September 29, 2002, at 09:12 PM, David Edelsohn wrote:

FYI, so far I have tracked the bug back to the cse2 pass. cse2 is
deleting ZERO_EXTENDs of the register representing the array slot
repeatedly written and read. With the ZERO_EXTEND only occurring once at
the beginning of the function, life_analysis is deleting the intermediary
instructions as dead.

Before cse2 the RTL looks like:

(insn 181 180 182 0 30038ec0 (set (reg:SI 156)
(zero_extend:SI (reg/v:HI 171))) -1 (nil)
(expr_list:REG_EQUAL (zero_extend:SI (mem:HI (plus:SI (reg:SI 133)
(symbol_ref:SI ("bndpsd"))) [4 S2 A16]))
(nil)))

(insn 197 196 198 0 30038ec0 (set (reg:SI 159)
(plus:SI (reg:SI 156)
(reg:SI 158))) -1 (nil)
(nil))

(insn 198 197 199 0 30038ec0 (set (reg/v:SI 154)
(sign_extend:SI (subreg:HI (reg:SI 159) 2))) -1 (nil)
(nil))

(insn 199 198 200 0 30038e40 (set (reg/v:HI 171)
(subreg:HI (reg/v:SI 154) 2)) -1 (nil)
(nil))

*REPEAT*

After cse2, the first unrolled iteration looks like that and the
remaining continue to use (reg:SI 156) without updating it from
(reg/v:HI 171) .
On Darwin the 14.bp dump looks like this:


(insn 181 263 182 9 0xe05690 (set (reg:SI 198)
        (zero_extend:SI (reg/v:HI 171))) -1 (nil)
    (nil))

(insn 183 182 184 9 0xe05690 (set (reg:SI 200)
        (plus:SI (reg:SI 198)
            (reg:SI 199))) -1 (nil)
    (nil))

(insn 184 183 185 9 0xe05690 (set (reg:SI 197)
        (sign_extend:SI (subreg:HI (reg:SI 200) 2))) -1 (nil)
    (nil))

(insn 185 184 187 9 0xdbb360 (set (reg/v:HI 171)
        (subreg:HI (reg:SI 197) 2)) -1 (nil)
    (nil))

*REPEAT*

but cse2 does not muck it up; it continues to use a new pseudo
for each zero_extend(171).  The obvious difference is the lack
of the REG_EQUAL note.  Is this right?


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