This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: loop hoisting fails
- From: Richard Henderson <rth at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: "Paulo J. Matos" <pocmatos at gmail dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 10 Feb 2011 09:59:58 -0800
- Subject: Re: loop hoisting fails
- References: <iiu0pq$ioe$1@dough.gmane.org> <mcrd3n1p7pi.fsf@google.com>
On 02/09/2011 07:07 AM, Ian Lance Taylor wrote:
> "Paulo J. Matos" <pocmatos@gmail.com> writes:
>
>> But then this is combined by cse into:
>>
>> (set (mem/s:QI (reg:QI 41)) (const_int 0))
>>
>> and bammm, same problem. No loop hoisting. What's the best way to
>> handle this? Any suggestions?
>
> You need to set TARGET_RTX_COSTS to indicate that this operation is
> relatively expensive. That should stop combine from generating it.
If constants are never valid as the source of a store,
then you could try something like
register_operand (operands[0], <mode>)
|| register_operand (operands[1], <mode>)
in the extra-predicate field of your move insns. This
is not unlike the check for two memories that many ports
use at the moment. C.f. movsi_internal for i386.
That will prevent combine, or anyone else for that matter,
from re-combining the constant load.
r~