[tree-ssa] Re: COND_EXPR lowering patch
Andrew MacLeod
amacleod@redhat.com
Mon Aug 25 15:48:00 GMT 2003
On Sat, 2003-08-23 at 13:52, Zdenek Dvorak wrote:
> ... is not quite ready yet, but I am getting closer.
>
> The main showstopper seems to be the tree-ssa-dce; after this change
> it cannot work in the current form (resp. it could, but since most of the
> interesting control flow will then be expressed by explicit gotos, it
> would be useless).
>
> It was discussed before, but afair there was not any definitive
> conclusion. To me the following scheme seems to be the best:
> The control structures removal part will only be activated with -O3
> and will be done using regular control dependency analysis.
>
I think it better to simply handle the DCE issue under flag control so
we can choose to call light or heavyweight DCE at our whim.
> Rationale: this part of the optimization is rarely useful, and even if
> it does something, ordinary dce together with jump threading does it
> anyway (not completely, but for the most interesting cases it should
> work). It is also quite costly, which makes it a clear candidate for
> -O3. And this also seems to be the easiest way, since Jeff has the
> requiered patch iirc.
>
> Your opinions?
>
I have the following patch, which was bootstrapped a week ago or so,
which changes DCE to have a flag which enables or disables removal of
control flow stmt's. The patch basically make all control flow stmt's
necessary, which results in a much trimmer DCE since we never have to go
looking at control dependancies. The first call to DCE is now
lightweight since it ignores assumes all control flow is neccesary. The
final call removes control flow.
For your purposes, we'd then have to change the last call to DCE to pass
in false so that it doesnt look at control flow in the final pass until
we test and integrate proper control dependancy checking. This allows
you to bypass the control flow for now, and then we can change the
parent_stmt implementation to proper control flow dependacy tracking at
a more convienient time. (I went digging but didnt find a copy of Jeffs
control dependancy patch. Give me a copy and I'll work with it if you
want)
I'm running this through the latest source code this morning, and I will
check it in if there are no complaints and it still bootstraps et al. I
think it'll give you something you can then move forward with.
Andrew
More information about the Gcc
mailing list