This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR65768] Check rtx_cost when propagating constant
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: Kugan <kugan dot vivekanandarajah at linaro dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 15 Apr 2015 13:18:04 +0200
- Subject: Re: [PR65768] Check rtx_cost when propagating constant
- Authentication-results: sourceware.org; auth=none
- References: <552E1907 dot 4090708 at linaro dot org> <CABu31nNNDY0_ti0T_wYKBQuCPd9rEj_zmhm9JnnA0q7HSbyLiA at mail dot gmail dot com>
On Wed, Apr 15, 2015 at 11:05 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Wed, Apr 15, 2015 at 9:53 AM, Kugan wrote:
>> 2015-04-15 Kugan Vivekanandarajah < >
>> Zhenqiang Chen <>
>>
>> PR target/65768
>> * cprop.c (try_replace_reg): Check cost of constants before propagating.
>
>
>> +
>> + /* For CONSTANT_P (to), loop2_invariant pass might hoist it out the loop.
>> + And it can be shared by different references. So skip propagation if
>> + it makes INSN's rtx cost higher. */
>> +
>
> So only undo if the insn is inside a loop (i.e.
> BLOCK_FOR_INSN(insn)->loop_father != NULL) and this is a
> post-pass_loop2 cprop run?
post loop2 loops are destroyed. When loops are available loop_father
is always non-NULL, the proper check is for loop_outer (->loop_father) == NULL.
or loop_depth (->loop_father) != 0.
Richard.
>
> Ciao!
> Steven