This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: several messages
- To: Jeffrey A Law <law at cygnus dot com>, Richard Henderson <rth at cygnus dot com>
- Subject: Re: several messages
- From: Michael Matz <matzmich at cs dot tu-berlin dot de>
- Date: Fri, 18 Aug 2000 17:43:35 +0200 (MET DST)
- cc: gcc-patches at gcc dot gnu dot org
Hi,
sorry for taking so long to answer, but I was away some time, and now my
mailbox is flooded ;)
On Tue, 1 Aug 2000, Jeffrey A Law wrote:
> Some general notes about the dominator code.
...
Thanks. As I said, it was a first version, so people can look at the
general algorithms. It was by no means ready (style-wise at least ;).
> What is TBB? You use it in a number of places, but I have no idea what it's
TBB == Type Basicblock ;) (In a former life I was a great fan of Turbo
Pascal, and now I'm still calling my types Txxx sometime ;)
> Low level stuff:
>
> The formatting for init_ar, stack_top,stack_pop has a number of problems.
They were supposed to be throw-away macros, but they survived somehow. So
even such macros should follow the coding standards? No problem.
> Comments should be complete sentences with proper capitalization and
> punctuation. You have several that start with lower case.
Hmm. Seems so. I first wrote the code, with some comment in them. Then
after some time (the code was done), I wrote comments all over the place,
which was boring ;) It seems I was so tired, that I forgot to change some
to the comment standard. OTOH some of them start with a variable name,
which is spelled lowercase, so what should I do?
> Most of our code could stand for some whitespace at boundaries where you
> transition from one logical task to another. For example, you have code
I thought, exactly that was the reason, that '{' should be on an extra
line itself (and I use colorizing editors ;) I'll insert some white lines
here and there.
> There's a lot more code to look at, but I'm not going to be able to do it
> soon.
;-(
> I figured at least getting you some of my initial comments might be
> helpful.
Of course, thanks.
On Thu, 3 Aug 2000, Richard Henderson wrote:
> On Sat, Jun 24, 2000 at 04:22:15AM +0200, Michael Matz wrote:
> > compute_flow_dominators (dominators, post_dominators)
> > + sbitmap *dominators;
> > + sbitmap *post_dominators;
> > +{
> > + if (dominators)
> > + {
> > + calculate_flow_dominators (dominators, 0);
> > + }
>
> I'd prefer that we not create such trivial wrapper functions. Instead,
> just modify all current users of compute_flow_dominators to use your
> new function.
This is the plan, yes. I can only state the reason I've done the above for
now. As I wrote it, it was clear, that it'll take some time, until the
code is included (I hadn't even the assignment ready). So I expected quite
some changes in gcc over time, and in this way my local changes to gcc's
source (with its potential for conflicts) were kept to a minimum.
> Additionally, since the algorithm has the entire dominator tree, then
> immediate dominators are available directly. You should export an
> interface to get at them, and then replace the existing
> compute_immediate_dominators function.
Yep. I hadn't done that, because (at the time I wrote it at least) that
function wasn't used anywere in gcc, so there would have been no direct
test for correctness (only the indirect one over the dominators).
On Fri, 4 Aug 2000, Jeffrey A Law wrote:
> >From ldc.c:
> /* This file implements an algorithm for calculating dominators in linear
> time, as presented in ftp://ftp.diku.dk/diku/semantics/papers/D-320.ps.gz
>
> I wasn't able to connect to that FTP server. Do you have a copy of this
> paper that you could send me? It would greatly help in trying to understand
> this code.
Yes, without the paper its not the easiest thing ;) I believe, you have it
now, if not, just tell me again.
Thanks again for your comments, I hope I have some time on the weekend to
change the source accordingly.
Ciao,
Michael.