Richard Maine wrote:
"... for an array of that size, it is unlikely that the
compiler is going to be particularly "smart" about optimizing
a parameter array as opposed to a variable one."
In the case that the entity is a module entity, as opposed to one
declared inside of a procedure, there may be optimization implications
if it's not private, no matter now big it is.
Suppose module C has such an entity, suppose module A accesses it, and
suppose a procedure in module A calls an external one or one from a module B.
If the entity is a variable, the compiler can't suppose that the value of
(an element of) it will remain unchanged after the call. This may have
implications for register management (especially in systems with register
windows) or for common subexpression elimination. In addition to the inter-
statement optimization case (which I know is forbidden, but everybody does
it anyway), there is the possibility that optimization of e.g.
x = LargeIckyExpression * f(y) + LargeIckyExpression
(with _the_same_ LargeIckyExpression in both cases) might be subverted if
f is not known to be pure.
--
What fraction of Americans believe | Van Snyder
Wrestling is real and NASA is fake? | [log in to unmask]
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Dan Goldin, George Bush, the Pope, or anybody else.
|