This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question about pattern combining
- From: Leehod Baruch <LEEHOD at il dot ibm dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 17 Aug 2004 11:00:07 +0300
- Subject: Question about pattern combining
- Reply-to:
- Sensitivity:
Hello,
Regarding the pattern:
(insn 36 35 38 0 (set (reg:DI 127)
(sign_extend:DI (reg:SI 130))) 15 {*rs6000.md:441} (insn_list 35
(nil))
(expr_list:REG_DEAD (reg:SI 130)
(nil)))
(insn 38 36 39 0 (set (reg:SI 131)
(plus:SI (subreg:SI (reg:DI 125) 4)
(subreg:SI (reg:DI 127) 4))) 36 {*addsi3_internal1} (insn_list
33
(insn_list 36
(nil)))
(expr_list:REG_DEAD (reg:DI 125)
(expr_list:REG_DEAD (reg:DI 127)
(nil))))
Combine should modify insn 38 to be:
(insn 38 36 39 0 (set (reg:SI 131)
(plus:SI (subreg:SI (reg:DI 125) 4)
(reg:SI 130))) 36 {*addsi3_internal1} (insn_list 33
(insn_list 35 (nil)))
(expr_list:REG_DEAD (reg:DI 125)
(expr_list:REG_DEAD (reg:SI 130)
(nil))))
and insn 36 should be removed.
Currently this does not happen. The reason is that during combine the
(reg:DI 127) in insn 38 is replaced with the rhs of insn 36 using subst,
but
subst simplifies the sign-extension to ASHIFTRT ( ASHIFT ()) and then the
pattern is not recognized.
By disabling the algebraic simplification of sign extension inside
combine_simplify_rtx (removing the call to expand_compound_operation()),
combine succeeded to recognize the above pattern and works properly.
There is, of course, a tradeoff. This may disable other patterns from been
combined.
Does anyone has a better solution for the problem.
Thanks,
Leehod