decrement_and_branch_until_zero pattern

Jim Wilson jimw@sifive.com
Fri Jun 8 20:12:00 GMT 2018


On 06/08/2018 06:21 AM, Paul Koning wrote:
> Interesting.  The ChangeLog doesn't give any background.  I suppose I should plan to approximate the effect of this pattern with a define-peephole2 ?

The old RTL loop optimizer was replaced with a new RTL loop optimizer. 
When the old one was written, m68k was a major target, and the dbra 
optimization was written for it.  When the new one was written, m68k was 
not a major target, and this support was written differently.  We now 
have doloop_begin and doloop_end patterns that do almost the same thing, 
and can be created by the loop-doloop.c code.

There is a section in the internals docs that talks about this.
https://gcc.gnu.org/onlinedocs/gccint/Looping-Patterns.html

The fact that we still have decrement_and_branch_until_zero references 
in docs and target md files looks like a bug.  The target md files 
should use doloop patterns instead, and the doc references should be 
dropped.

Jim



More information about the Gcc mailing list