]> gcc.gnu.org Git - gcc.git/commit
[AArch64] Improve TLS Descriptor pattern to release RTL loop IV opt
authorJiong Wang <jiwang@gcc.gnu.org>
Thu, 6 Aug 2015 16:08:39 +0000 (16:08 +0000)
committerJiong Wang <jiwang@gcc.gnu.org>
Thu, 6 Aug 2015 16:08:39 +0000 (16:08 +0000)
commitb2074542354ae9cd2166dc3d0529edf71b9ae8e6
tree85b92d1dc9bfcdf08b06afb7e66e63116496e627
parent201fa0b3a0a4aaf53ec0bcd154f40e2f63a8d960
[AArch64] Improve TLS Descriptor pattern to release RTL loop IV opt

The instruction sequences for preparing argument for TLS descriptor
runtime resolver and the later function call to resolver can actually be
hoisted out of the loop.

Currently we can't because we have exposed the hard register X0 as
destination of "set".  While GCC's RTL data flow infrastructure will
skip or do very conservative assumption when hard register involved in
and thus some loop IV opportunities are missed.

This patch add another "tlsdesc_small_pseudo_<mode>" pattern, and avoid
expose x0 to gcc generic code.

Generally, we define a new register class FIXED_R0 which only contains register
0, so the instruction sequences generated from the new add pattern is the same
as tlsdesc_small_<mode>, while the operand 0 is wrapped as pseudo register that
RTL IV opt can handle it.

Ideally, we should allow operand 0 to be any pseudo register, but then
we can't model the override of x0 caused by the function call which is
hidded by the UNSPEC.

So here, we restricting operand 0 to be x0, the override of x0 can be
reflected to the gcc.

2015-08-06    Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
      Jiong Wang  <jiong.wang@arm.com>
gcc/
  * config/aarch64/aarch64.d (tlsdesc_small_pseudo_<mode>): New pattern.
  * config/aarch64/aarch64.h (reg_class): New enumeration FIXED_REG0.
  (REG_CLASS_NAMES): Likewise.
  (REG_CLASS_CONTENTS): Likewise.
  * config/aarch64/aarch64.c (aarch64_class_max_nregs): Likewise.
  (aarch64_register_move_cost): Likewise.
  (aarch64_load_symref_appropriately): Invoke the new added pattern if
  possible.
  * config/aarch64/constraints.md (Uc0): New constraint.

gcc/testsuite/
  * gcc.target/aarch64/tlsdesc_hoist.c: New testcase.

From-SVN: r226683
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/tlsdesc_hoist.c [new file with mode: 0644]
This page took 0.062686 seconds and 5 git commands to generate.