public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH v3 0/2] Generate offset adjusted operation for op_by_pieces operations
Date: Mon, 26 Apr 2021 18:14:24 -0700	[thread overview]
Message-ID: <20210427011426.479089-1-hjl.tools@gmail.com> (raw)

Add an overlap_op_by_pieces_p target hook for op_by_pieces operations
between two areas of memory to generate one offset adjusted operation
in the smallest integer mode for the remaining bytes on the last piece
operation of a memory region to avoid doing more than one smaller
operations.

Pass the RTL information from the previous iteration to m_constfn in
op_by_pieces operation so that builtin_memset_[read|gen]_str can
generate the new RTL from the previous RTL.

The v3 changes:

1. Split changing a while loop in op_by_pieces_d::run to a do-while loop
into a separate patch for easier review.
2. Simplify the builtin_memset_read_str change.
3. Document that offset adjusted operation is unaligned.

The v2 changes are:

1. Added a target hook, TARGET_OVERLAP_OP_BY_PIECES_P.
2. Added a pointer argument to pieces_addr::adjust to pass the RTL
information from the previous iteraton to m_constfn.
3. Updated builtin_memset_read_str and builtin_memset_gen_str to
generate the new RTL from the previous RTL info.

H.J. Lu (2):
  op_by_pieces_d::run: Change a while loop to a do-while loop
  Generate offset adjusted operation for op_by_pieces operations

 gcc/builtins.c                             |  36 ++++-
 gcc/builtins.h                             |   6 +-
 gcc/config/i386/i386.c                     |   3 +
 gcc/doc/tm.texi                            |   7 +
 gcc/doc/tm.texi.in                         |   2 +
 gcc/expr.c                                 | 171 ++++++++++++++++-----
 gcc/expr.h                                 |  10 +-
 gcc/target.def                             |   9 ++
 gcc/testsuite/g++.dg/pr90773-1.h           |  14 ++
 gcc/testsuite/g++.dg/pr90773-1a.C          |  13 ++
 gcc/testsuite/g++.dg/pr90773-1b.C          |   5 +
 gcc/testsuite/g++.dg/pr90773-1c.C          |   5 +
 gcc/testsuite/g++.dg/pr90773-1d.C          |  19 +++
 gcc/testsuite/gcc.target/i386/pr90773-1.c  |  17 ++
 gcc/testsuite/gcc.target/i386/pr90773-10.c |  13 ++
 gcc/testsuite/gcc.target/i386/pr90773-11.c |  13 ++
 gcc/testsuite/gcc.target/i386/pr90773-12.c |  11 ++
 gcc/testsuite/gcc.target/i386/pr90773-13.c |  11 ++
 gcc/testsuite/gcc.target/i386/pr90773-14.c |  13 ++
 gcc/testsuite/gcc.target/i386/pr90773-2.c  |  20 +++
 gcc/testsuite/gcc.target/i386/pr90773-3.c  |  23 +++
 gcc/testsuite/gcc.target/i386/pr90773-4.c  |  13 ++
 gcc/testsuite/gcc.target/i386/pr90773-5.c  |  13 ++
 gcc/testsuite/gcc.target/i386/pr90773-6.c  |  11 ++
 gcc/testsuite/gcc.target/i386/pr90773-7.c  |  11 ++
 gcc/testsuite/gcc.target/i386/pr90773-8.c  |  13 ++
 gcc/testsuite/gcc.target/i386/pr90773-9.c  |  13 ++
 27 files changed, 446 insertions(+), 49 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/pr90773-1.h
 create mode 100644 gcc/testsuite/g++.dg/pr90773-1a.C
 create mode 100644 gcc/testsuite/g++.dg/pr90773-1b.C
 create mode 100644 gcc/testsuite/g++.dg/pr90773-1c.C
 create mode 100644 gcc/testsuite/g++.dg/pr90773-1d.C
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-1.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-10.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-11.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-12.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-13.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-14.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-2.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-3.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-4.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-5.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-6.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-7.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-8.c
 create mode 100644 gcc/testsuite/gcc.target/i386/pr90773-9.c

-- 
2.31.1


             reply	other threads:[~2021-04-27  1:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  1:14 H.J. Lu [this message]
2021-04-27  1:14 ` [PATCH v3 1/2] op_by_pieces_d::run: Change a while loop to a do-while loop H.J. Lu
2021-04-27 13:05   ` Richard Biener
2021-04-27  1:14 ` [PATCH v3 2/2] Generate offset adjusted operation for op_by_pieces operations H.J. Lu
2021-04-29 11:08   ` Richard Biener

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=20210427011426.479089-1-hjl.tools@gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).