This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with peephole to peephole2 conversion



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]