This is the mail archive of the
mailing list for the GCC project.
Re: COND_EXPR lowering patch
- From: law at redhat dot com
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 25 Aug 2003 09:33:10 -0600
- Subject: Re: COND_EXPR lowering patch
- Reply-to: law at redhat dot com
In message <20030823175250.GA21952@atrey.karlin.mff.cuni.cz>, Zdenek Dvorak wri
>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).
Actually, as I've stated before, I believe the existing tree-ssa-dce
should continue to work, even after you've lowered COND_EXPRs because
we mark the parents of an incoming GOTO_EXPR as being necessary.
So if we have
As soon as something in the block starting at label3 is marked as
necessary, we look at the incoming edges and mark as necessary any
GOTO_EXPRs which reach our block. Thus "goto label3" is entered
into the worklist.
When we process "goto label3", we mark its control parent as necessary
(the if (y) statement) and add it to the worklist. At that time we'll
also mark the GOTO_EXPR which reaches this block as necessary (ie
the "goto label1" statement).
When we process the "if (y)" statement we mark whatever statements
set "y" as necessary.
When we process "goto label1", we'll mark its control parent as necessary
>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 would much prefer to not push this into -O3. Instead I would rather
see the control structure removal happen at -O2, but only on the
final pass of DCE.
Marginally related, I'm pretty sure DSE will need the post-dominators
to do a good job. It may make sense to have DCE/DSE share the cost
of building the post-dominator information.