[PATCH][AArch64] Handle function literal pools according to function size

Evandro Menezes e.menezes@samsung.com
Fri Nov 13 22:36:00 GMT 2015

    [AArch64] Handle function literal pools according to function size


        PR target/63304
        * config/aarch64/aarch64-protos.h
        Move to module scope in "aarch64.c".
        (aarch64_may_load_literal_pcrel) New function.
        * config/aarch64/aarch64.c (aarch64_nopcrelative_literal_loads):
        scope to module.
        (aarch64_may_load_literal_pcrel): New function that replaces the
        variable "aarch64_nopcrelative_literal_loads" in most cases.
        (aarch64_current_func_size): New function.
        * config/aarch64/aarch64.h (machine_function): Add new member
        * config/aarch64/aarch64.md
        Use "aarch64_may_load_literal_pcrel".
        (aarch64_reload_movcp<VALL:mode><P:mode>): Likewise.

Since defaulting to always using a global literal pool results in 
possible performance degradation on targets without insn fusion of the 
resulting insns, this tentative patch reverts to per function literal 
pool when the function size allows it or to the global literal pool 

Though the global literal pool promotes reuse of constants with positive 
impact in text size, it comes at the cost of increased I-cache pressure, 
since it then takes a pair of insns to access a literal.  Conversely, 
the per function literal pools limit reuse of constants, but reduce 
I-cache pressure due to then just a PC-relative load being used to 
access a literal.  I hope to have data to quantifying such analysis soon.

Bootstrapped in aarch64 and arm.

Feedback is welcome.

Evandro Menezes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AArch64-Handle-function-literal-pools-according-to-f.patch
Type: text/x-patch
Size: 7853 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151113/c53689c6/attachment.bin>

More information about the Gcc-patches mailing list