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

Is this wrong optimization in cse1 pass?


Hello,
I am experimenting some cond_exec patterns to better support
predicate in our target. I came across the following optimization
done in cse1, and not sure if it is correct behaviour or my fault.
Basically, cse1 performs copy propagation for insn 12 and 16 based
on assignment in insn 10. However, there is a conditional assignment
of reg 86 in insn 11. Shouldn't GCC perform the optimization here?
Our port is based on latest 4.5 branch.

tst.c.149r.jump
(insn 10 9 11 2 tst.c:16 (set (reg/v:V2SI 86 [ c ])
        (reg/v:V2SI 85 [ c ])) 190 {fp_movv2si} (nil))

(insn 11 10 12 2 tst.c:16 (cond_exec (ne (reg/v:PR 83 [ p ])
            (const_int 0 [0x0]))
        (set (reg/v:V2SI 86 [ c ])
            (reg:V2SI 90))) 511 {fp_predv2si} (nil))

(insn 12 11 16 2 tst.c:16 (set (reg:V2SI 87 [ <retval> ])
        (reg/v:V2SI 86 [ c ])) 190 {fp_movv2si} (nil))

(insn 16 12 19 2 tst.c:18 (set (reg/i:V2SI 8 r8)
        (reg:V2SI 87 [ <retval> ])) 190 {fp_movv2si} (nil))

tst.c.152r.cse1
(insn 10 9 11 2 tst.c:16 (set (reg/v:V2SI 86 [ c ])
        (reg/v:V2SI 85 [ c ])) 190 {fp_movv2si} (nil))

(insn 11 10 12 2 tst.c:16 (cond_exec (ne (reg/v:PR 83 [ p ])
            (const_int 0 [0x0]))
        (set (reg/v:V2SI 86 [ c ])
            (reg:V2SI 90))) 511 {fp_predv2si} (nil))

(insn 12 11 16 2 tst.c:16 (set (reg:V2SI 87 [ <retval> ])
        (reg/v:V2SI 85 [ c ])) 190 {fp_movv2si} (nil))

(insn 16 12 19 2 tst.c:18 (set (reg/i:V2SI 8 r8)
        (reg/v:V2SI 85 [ c ])) 190 {fp_movv2si} (nil))


Cheers,
Bingfeng Mei


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