This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH][PPC] Remove unnecessary local variable mptwo
On Thu, Jan 10, 2013 at 12:06 PM, Roland McGrath <email@example.com> wrote:
>> > It's an initialized non-static local variable that has to be
>> > constructed on every invocation of __inv. Replacing that with a
>> > reference to a hidden global variable has got to be an improvement.
>> Right, that was the rationale. I haven't done an actual comparison of
>> the generated code since it's quite straightforward, but I can do that
>> tomorrow if necessary.
> It seems appropriate to check. In many cases an initialized local like
> that gets folded into its uses and occupies no stack space and uses less
> code compared to the load from a global.
By which, you mean, if the element access is predictable enough the
compiler will simply populate a register with the referenced value and
use it instead of checking any actual data structure constructed on
the stack, and will in-fact decline to generated that data structure