This is the mail archive of the gcc-bugs@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]

reload_cse() missed opportunities


I've been looking at GCC-SH4 output for stress-1.17/layer3.i and I've
noticed that reload_cse() (cselib) is missing some optimization cases.

Consider:

        mov     #64,r1       
        fmov    fr15,fr3
        add     r14,r1
        mov.l   @(0,r1),r1
        mov     #64,r2		<- redundant
        add     r14,r2		<- redundant
        add     #4,r1
        fdiv    dr0,dr2

Both r1 and r2 contain "r14 + 64" yet reload_cse() fails to convert
this to:

	mov	#64,r1
	fmov	fr15,fr3
	add	r14,r1
	mov	r1,r2		<- replacement
	mov.l	@(0,r1),r1
	add	#4,r1
	fdiv	dr0,dr2

Is it reasonable to expect reload_cse/cselib to perform this optimization?

Toshi


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