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