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: [tree-ssa] where to fix this?

> In message <>, Jan Hubicka writes:
>  >I don't think the idea of actually doing the folding and then testing
>  >whether it is valid is good.  It costs memory and folder may get to be
>  >over-active stepping out of allowed ground missing allowed
>  >transformation as commonly happens for combine.
> There's certainly times when I'm going to want to give fold a fairly
> complex expression, but I'm going to want to know if the result of folding
> that complex non-gimple expression results in a gimple expression.  That
> can either be done in all the callers or it can be controlled by passing
> a flag/callback to the folder.

Hmm, this seems to be good argument why the idea of replacing all
complex folders by special purpose pass walking SSA graph won't work
very well. Uh oh.
Certainnly I can imagine cases where one would need such symbolic
simplification for loop optimization (we do that on RTL level for IV
discovery and counting number of iterations, Pop's code seems to be
doing same thing), but where we need it right now?

So the question is whether logic of such simplifier on nested trees can
be conviently shared with logic of simplifier matching nested
expressions via SSA graph walk.
> Given that we already have a couple places where we need this, I'd prefer
> to have this behavior in the folder itself, controlled by the caller setting
> the right flag and/or callback.

At least for loop optimizer we need relatively complex symbolic
transformations but we are not really interested in gimpleness of the
result, rather we need different properties (constantness of the result
or whether it is some kind of IV variable)
>  >Also how callback "it is valid transformation according to C standard"
>  >can be implemented?  It still has to know all the transformations C
>  >standard mention.
> The callback is set up by the front-end to call a front-end routine.

Yes, but what is unclear to me is how the front-end routine would look

> jeff

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