This is the mail archive of the
mailing list for the GCC project.
Re: What does PHI node mean? [GCC Internals Manual]
Cheng Renquan schrieb:
> From: Andrew Haley <email@example.com>
>> It's an interesting point. Do you think that the gccint manual should
>> assume some knowledge of how optimizing compilers work?
>> It's explained in
>> Advanced Compiler Design and Implementation, Steven Muchnick, ISBN 1558603204
>> We have never to my knowledge included links to Wikipedia in gcc
>> documentation, but this might be a good time to start.
> Thank you, I've also found SSA 's meaning through its abbrev wikipedia entry,
> but for PHI, I still did't find a good entry,
> Someone know what PHI means, please tell, thank you. My native language
> is not English, sorry for my understanding, but if someone really know
> "PHI", please tell, I will thank you;
> All through gccint manual, I only find one paragraph, looks like a
> definition for "PHI function" or "PHI node", but it also doesn't explain
> what "PHI" abbrev for? is "PHI" part of some word, or initial letter of
> three words?
PHI is Phi-Function where Phi stands for uppercase greek Phi, i.e. Φ in
HTML or \Phi in TeX. It's a concept rather that an abbrev.
Suppose you have C code like
x = 1;
x = 2;
In SSA form each variable must not be set more than once (statically).
So new names are introduced for x like x_1 and x_2
x_1 = 1;
x_2 = 2;
These two values have to be "merged" again to get x. The magic
which does (or expresses) this is denoted as PHI and called
x_1 = 1;
x_2 = 2;
x = PHI (x_1, x_2)
> I mean: if gccint has a terminology index or table, at least explain
> what it abbreviated for, maybe that would look better;
> just like any technology book has a term glossary, at the end;
Yes, a glossary would be great.