public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: gcc-patches@gcc.gnu.org
Cc: chenglulu <chenglulu@loongson.cn>,
	i@xen0n.name, xuchenghua@loongson.cn,
	mengqinggang <mengqinggang@loongson.cn>
Subject: Pushed: [PATCH 0/5] LoongArch: Better balance between relaxation and scheduling
Date: Mon, 23 Oct 2023 15:34:56 +0800	[thread overview]
Message-ID: <6d85cb0fa6fc4d2a29f7dec74f87bc8ed93943e9.camel@xry111.site> (raw)
In-Reply-To: <20231019140300.50323-1-xry111@xry111.site>

Pushed r14-{4848..4852}.

On Thu, 2023-10-19 at 22:02 +0800, Xi Ruoyao wrote:
> For relaxation we are now generating assembler macros for symbolic
> addresses everywhere, but this is limiting scheduling and there are
> known situations where the relaxation cannot improve the code.
> 
> 1. When we are performing LTO during a final link and the linker plugin
> is used, la.global won't be relaxed because they reference to an
> external or preemptable symbol.
> 2. The linker currently do not relax la.tls.*.
> 3. For la.local + ld/st pairs, if the address is only used once,
> emitting pcalau12i + ld/st is always not worse than relying on linker
> relaxation.
> 
> Add -mexplicit-relocs=auto to allow the compiler to use explicit relocs
> for these cases, but assembler macros for other cases.  Use it as the
> default if the assembler supports both explicit relocs and relaxation.
> 
> LTO-bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?
> 
> Xi Ruoyao (5):
>   LoongArch: Add enum-style -mexplicit-relocs= option
>   LoongArch: Use explicit relocs for GOT access when
>     -mexplicit-relocs=auto and LTO during a final link with linker
>     plugin
>   LoongArch: Use explicit relocs for TLS access with
>     -mexplicit-relocs=auto
>   LoongArch: Use explicit relocs for addresses only used for one load or
>     store with -mexplicit-relocs=auto and -mcmodel={normal,medium}
>   LoongArch: Document -mexplicit-relocs={auto,none,always}
> 
>  .../loongarch/genopts/loongarch-strings       |   6 +
>  gcc/config/loongarch/genopts/loongarch.opt.in |  21 ++-
>  gcc/config/loongarch/loongarch-def.h          |   6 +
>  gcc/config/loongarch/loongarch-protos.h       |   1 +
>  gcc/config/loongarch/loongarch-str.h          |   5 +
>  gcc/config/loongarch/loongarch.cc             |  75 ++++++++--
>  gcc/config/loongarch/loongarch.h              |   3 +
>  gcc/config/loongarch/loongarch.md             | 128 +++++++++++++++++-
>  gcc/config/loongarch/loongarch.opt            |  21 ++-
>  gcc/config/loongarch/predicates.md            |  15 +-
>  gcc/doc/invoke.texi                           |  37 +++--
>  .../loongarch/explicit-relocs-auto-lto.c      |  26 ++++
>  ...-relocs-auto-single-load-store-no-anchor.c |   6 +
>  .../explicit-relocs-auto-single-load-store.c  |  14 ++
>  .../explicit-relocs-auto-tls-ld-gd.c          |   9 ++
>  .../explicit-relocs-auto-tls-le-ie.c          |   6 +
>  16 files changed, 343 insertions(+), 36 deletions(-)
>  create mode 100644 gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-lto.c
>  create mode 100644 gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-single-load-store-no-anchor.c
>  create mode 100644 gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-single-load-store.c
>  create mode 100644 gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-tls-ld-gd.c
>  create mode 100644 gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-tls-le-ie.c
> 

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

      parent reply	other threads:[~2023-10-23  7:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 14:02 Xi Ruoyao
2023-10-19 14:02 ` [PATCH 1/5] LoongArch: Add enum-style -mexplicit-relocs= option Xi Ruoyao
2023-10-19 14:02 ` [PATCH 2/5] LoongArch: Use explicit relocs for GOT access when -mexplicit-relocs=auto and LTO during a final link with linker plugin Xi Ruoyao
2023-10-21  7:32   ` chenglulu
2023-10-21  8:42     ` Xi Ruoyao
2023-10-23  0:56       ` chenglulu
2023-10-19 14:02 ` [PATCH 3/5] LoongArch: Use explicit relocs for TLS access with -mexplicit-relocs=auto Xi Ruoyao
2023-10-19 14:02 ` [PATCH 4/5] LoongArch: Use explicit relocs for addresses only used for one load or store with -mexplicit-relocs=auto and -mcmodel={normal,medium} Xi Ruoyao
2023-10-19 14:03 ` [PATCH 5/5] LoongArch: Document -mexplicit-relocs={auto,none,always} Xi Ruoyao
2023-10-23  7:34 ` Xi Ruoyao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d85cb0fa6fc4d2a29f7dec74f87bc8ed93943e9.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --cc=mengqinggang@loongson.cn \
    --cc=xuchenghua@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).