Problem with peephole to peephole2 conversion
Paolo Bonzini
paolo.bonzini@lu.unisi.ch
Thu Aug 25 12:40:00 GMT 2005
>>>operands[0] == operands[1] || peep2_regno_dead_p (2, operands[0])
>>>
>>Exactly.. this is the same thing as calling dead_or_set_p(insn,
>>operands[0]).
>>
>>
>i am sorry, since we are using peephole2, the variable "insn" points
>to the first insn in the template and not the last. so the call should
>be dead_or_set_p(next_nonnote_insn(insn),operands[0])
>
>
I consider this to be less readable than the peep2 way to do it,
especially if your peephole2 had three or four instructions. And
peep2_regno_dead_p uses an array (a circular buffer) so it's more
efficient. Indeed dead_or_set_p even has a loop inside it.
Paolo
More information about the Gcc
mailing list