An issue for the SC: horrible documentation quality of GCC
Michael Matz
matz@suse.de
Fri May 9 14:37:00 GMT 2003
Hi,
On Fri, 9 May 2003, Richard Kenner wrote:
> Also before the *local_cprop* functions, except local_cprop_pass(),
> which is only called at toplevel from one_cprop_pass().
>
> Also, what does "local" mean in this context? I'd take it as the opposite
> of "global", meaning to me that this does an optimzation on a small part of
> the function being compiled. Which part? I see no documentation of that.
>
> Or is this just a confusing name?
It seems to be a confusing name, as it doesn't work locally at all. In
fact the whole local_cprop pass makes a go over _all_ instructions
(and not per basic block, but instead by NEXT_INSN) using
cselib to propagate constants and register sources into uses. I.e. it
converts such code:
p1 <-- 100
p2 <-- p1 + p3
into
p1 <-- 100
p2 <-- 100 + p3
And also this
p1 <-- p4
p2 <-- p1 + p3
into
p1 <-- p4
p2 <-- p4 + p3
The goal of this is to possibly remove all references to a pseudo, and
hence make the definition trivially deletable, which is faster than any
data flow based dead code removal, but also removes less code. But it
might be Good Enough to be used repeatedly inside the GCSE loop.
Ciao,
Michael.
More information about the Gcc
mailing list