peephole optimizations
Jeff Law
law@redhat.com
Tue May 4 15:49:00 GMT 2010
On 05/04/10 01:18, roy rosen wrote:
> Hi,
>
> 2010/5/3, Ian Lance Taylor<iant@google.com>:
>
>> roy rosen<roy.1rosen@gmail.com> writes:
>>
>>
>>> 1. Is that true that if I try to match in the pattern two insns and in
>>> my code between these insns there is another insn which does not have
>>> any dependency connection to the other two, Is that true that the
>>> peephole would not match in this case? (i.e. the insns to match must
>>> come in the code in sequential order with no other insns between
>>> them)?
>>>
>> Yes.
>>
>>
> Was there any special problem implementing such peephole mechanism or
> simply nobody tried to work on this yet?
>
> I think it may be very beneficial since I guess that for most
> patterns, there are other insns between the pattern's insns which
> cause the peephole not to match...
>
In general, peepholes (in the GCC world) are typically only used when
there is no obvious data dependency between insns and thus the combiner
phase of GCC doesn't know to try and optimize the two (or three)
insns. It has been our experience that peepholes are only
occasionally useful and thus we haven't spent considerable time
improving the infrastructure for the peephole optimizer.
Jeff
More information about the Gcc
mailing list