This is the mail archive of the gcc-patches@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: [PATCH] Fold more aggressively for trip counts


On 1/3/07, Richard Guenther <richard.guenther@gmail.com> wrote:
On 1/3/07, Robert Kennedy <jimbob@google.com> wrote:
> Attached is a patch to do a little bit of extra work in analyzing trip
> counts for loops. As a side benefit, some other phases will perhaps
> get slightly better folding results.
>
> The motivation for this patch came from some experiments I did with
> doing strength reduction and linear function test replacement rather
> early in optimization, before, e.g., vectorization. At first, code
> introduced by SR caused some failures by keeping loops from being
> analyzed well, hence the genesis of this patch.
>
> Bootstrapped and tested on i686-pc-linux-gnu.

The fold-const change is ok if you add a testcase.
tree_simplify_using_condition_1
is already complex, ugly and slow - we shouldn't add to that more.
Can you provide
a testcase and see where we create a comparison that makes this extra testing
worthwhile?  Can you fix this place instead?


The main place that exposes this is the Operator Strength Reduction pass, which is not yet committed or submitted. These are mainly generated by the exit test replacement it performs Theoretically you could work around this by moving OSR much earlier than where we have it now, and then some other pass would probably simplify these (VRP is my guess), but doing so is not really feasible (You don't want to run strength reduction too early, it makes things harder to analyze. We currently have it right before ivopts, which is somewhere that both Zdenek and i agree is the right place for such a pass).


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