]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[POWERPC] Optimize account_system_vtime
authorMilton Miller <miltonm@bga.com>
Fri, 14 Dec 2007 04:52:20 +0000 (15:52 +1100)
committerPaul Mackerras <paulus@samba.org>
Thu, 20 Dec 2007 05:15:46 +0000 (16:15 +1100)
commit53024fe250a0f044b114844a01456902bce40ade
treedd4b4c6165523bbb20767a192bc01681e370e009
parentdb3801a858e97adee0f3b4c732e6ff325d95e0a5
[POWERPC] Optimize account_system_vtime

We have multiple calls to has_feature being inlined, but gcc can't
be sure that the store via get_paca() doesn't alias the path to
cur_cpu_spec->feature.

Reorder to put the calls to read_purr and read_spurr adjacent to each
other.  To add a sense of consistency, reorder the remaining lines to
perform parallel steps on purr and scaled purr of each line instead of
calculating and then using one value before going on to the next.

In addition, we can tell gcc that no SPURR means no PURR.  The test is
completely hidden in the PURR case, and in the !PURR case the second test
is eliminated resulting in the simple register copy in the out-of-line
branch.

Further, gcc sees get_paca()->system_time referenced several times and
allocates a register to address it (shadowing r13) instead of caching its
value.  Reading into a local varable saves the shadow of r13 and removes
a potentially duplicate load (between the nested if and its parent).

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/time.c