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]
Other format: [Raw text]

Re: [PATCH] Add zero-overhead looping for xtensa backend

On Fri, Oct 10, 2014 at 6:59 AM, Felix Yang <> wrote:
> Hi Sterling,
>     I made some improvement to the patch. Two changes:
>     1. TARGET_LOOPS is now used as a condition of the doloop related
> patterns, which is more elegant.


>     2. As the trip count register of the zero-cost loop maybe
> potentially spilled, we need to change the patterns in order to handle
> this issue.

Actually, for xtensa you don't. The trip count is copied into LCOUNT
at the execution of the loop instruction, and therefore a spill or
whatever doesn't matter--it won't affect the result. So as long as you
have the trip count at the start of the loop, you are fine.

This does bring up an issue of whether or not the trip count can be
modified during the loop. (note that this is different than early
exit.) If it can, you can't use a zero-overhead loop. Does your patch
address this case.

The solution is similar to that adapted by c6x backend.
> Just turn the zero-cost loop into a regular loop when that happens
> when reload is completed.
>     Attached please find version 4 of the patch. Make check regression
> tested with xtensa-elf-gcc/simulator.
>     OK for trunk?

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