[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freepooma-devel] [PATCH] Speeeeed up DomainIterator
From: |
Richard Guenther |
Subject: |
Re: [Freepooma-devel] [PATCH] Speeeeed up DomainIterator |
Date: |
Thu, 14 Apr 2005 11:27:01 +0200 (CEST) |
On Thu, 7 Apr 2005, Richard Guenther wrote:
>
> This patch builds on the domain cleanup and yields considerable
> code improvements for DomainIterator. The trick is to simplify
> the CFG that is fed into the compiler considerably and to hint
> it with branch probabilities to do the right BB ordering.
>
> Also, the previous code was quite stupid in that just reversing
> the counting of index_m yields in simpler loop exit tests, and
> stripping the first iteration out of the increment loop and
> reordering of the if/else bodies yields a much simpler CFG.
>
> Of course we need to be careful about non-unit-stride domains
> that do not allow indexing outside their domain with operator(),
> like Grid, so we provide a version for unit-stride domains and
> one for not-unit-stride domains.
>
>
> A remaining problem and optimization opportunity is the
> redundant iterator data, so that we need two increments and one
> decrement per iteration, and what is worse, we're creating two
> exit tests for the inner loop, though they are ordered such that
> modern processors will predict them correctly.
I found no way to do this optimization (with current compilers), so
the original patch was applied to HEAD.
Richard.
2005Apr14 Richard Guenther <address@hidden>
* src/Domain/DomainIterator.h: Change index_m to count downwards
to simplify exit condition. Speed up increment() by reordering
BBs and specializing it for unit-stride domains.