This is the mail archive of the 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]

Re: peephole vs. scheduler

>>>>> Dale Johannesen writes:

Dale> |  Ugh.  Gross.  Don't to that.
Dale> |  define_peephole2 or something close to that.

Dale> I don't understand this suggestion.  Could you expand?

	In the gcc development sources and gcc-3.0 a new "peephole2" pass
was introduced (motivated the IA-32 re-write, if I recall correctly).
Quoting the GCC TeXinfo:

There are two forms of peephole definitions that may be used.  The
original define_peephole is run at assembly output time to match insns and
substitute assembly text.  Use of define_peephole is deprecated.

A newer define_peephole2 matches insns and substitutes new insns.  The
peephole2 pass is run after register allocation but before scheduling,
which may result in much better code for targets that do scheduling.

	From your example, it seems like a peephole is not the correct
solution, but could improve the generated code in the short term.  Also,
based on your earlier message explaining why define_peephole was failing,
it seems like define_peephole2 is the style of peephole that you need to
perform the subsitution before scheduling breaks apart the instructions.

	The PowerPC machine description currently uses a few of the
original form peephole pattern and none of the new define_peephole2


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