public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/110248] ivopts could under-cost for some addressing modes on len_{load,store}
Date: Wed, 09 Aug 2023 06:17:16 +0000	[thread overview]
Message-ID: <bug-110248-4-AIJ78VKq0f@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110248-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110248

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Kewen Lin <linkw@gcc.gnu.org>:

https://gcc.gnu.org/g:165b1f6ad1d3969e2c23417797362d0528e65c79

commit r14-3092-g165b1f6ad1d3969e2c23417797362d0528e65c79
Author: Kewen Lin <linkw@linux.ibm.com>
Date:   Wed Aug 9 00:02:26 2023 -0500

    targhooks: Extend legitimate_address_p with code_helper [PR110248]

    As PR110248 shows, some middle-end passes like IVOPTs can
    query the target hook legitimate_address_p with some
    artificially constructed rtx to determine whether some
    addressing modes are supported by target for some gimple
    statement.  But for now the existing legitimate_address_p
    only checks the given mode, it's unable to distinguish
    some special cases unfortunately, for example, for LEN_LOAD
    ifn on Power port, we would expand it with lxvl hardware
    insn, which only supports one register to hold the address
    (the other register is holding the length), that is we
    don't support base (reg) + index (reg) addressing mode for
    sure.  But hook legitimate_address_p only considers the
    given mode which would be some vector mode for LEN_LOAD
    ifn, and we do support base + index addressing mode for
    normal vector load and store insns, so the hook will return
    true for the query unexpectedly.

    This patch is to introduce one extra argument of type
    code_helper for hook legitimate_address_p, it makes targets
    able to handle some special case like what's described
    above.

            PR tree-optimization/110248

    gcc/ChangeLog:

            * coretypes.h (class code_helper): Add forward declaration.
            * doc/tm.texi: Regenerate.
            * lra-constraints.cc (valid_address_p): Call target hook
            targetm.addr_space.legitimate_address_p with an extra parameter
            ERROR_MARK as its prototype changes.
            * recog.cc (memory_address_addr_space_p): Likewise.
            * reload.cc (strict_memory_address_addr_space_p): Likewise.
            * target.def (legitimate_address_p,
addr_space.legitimate_address_p):
            Extend with one more argument of type code_helper, update the
            documentation accordingly.
            * targhooks.cc (default_legitimate_address_p): Adjust for the
            new code_helper argument.
            (default_addr_space_legitimate_address_p): Likewise.
            * targhooks.h (default_legitimate_address_p): Likewise.
            (default_addr_space_legitimate_address_p): Likewise.
            * config/aarch64/aarch64.cc (aarch64_legitimate_address_hook_p):
Adjust
            with extra unnamed code_helper argument with default ERROR_MARK.
            * config/alpha/alpha.cc (alpha_legitimate_address_p): Likewise.
            * config/arc/arc.cc (arc_legitimate_address_p): Likewise.
            * config/arm/arm-protos.h (arm_legitimate_address_p): Likewise.
            (tree.h): New include for tree_code ERROR_MARK.
            * config/arm/arm.cc (arm_legitimate_address_p): Adjust with extra
            unnamed code_helper argument with default ERROR_MARK.
            * config/avr/avr.cc (avr_addr_space_legitimate_address_p):
Likewise.
            * config/bfin/bfin.cc (bfin_legitimate_address_p): Likewise.
            * config/bpf/bpf.cc (bpf_legitimate_address_p): Likewise.
            * config/c6x/c6x.cc (c6x_legitimate_address_p): Likewise.
            * config/cris/cris-protos.h (cris_legitimate_address_p): Likewise.
            (tree.h): New include for tree_code ERROR_MARK.
            * config/cris/cris.cc (cris_legitimate_address_p): Adjust with
extra
            unnamed code_helper argument with default ERROR_MARK.
            * config/csky/csky.cc (csky_legitimate_address_p): Likewise.
            * config/epiphany/epiphany.cc (epiphany_legitimate_address_p):
            Likewise.
            * config/frv/frv.cc (frv_legitimate_address_p): Likewise.
            * config/ft32/ft32.cc (ft32_addr_space_legitimate_address_p):
Likewise.
            * config/gcn/gcn.cc (gcn_addr_space_legitimate_address_p):
Likewise.
            * config/h8300/h8300.cc (h8300_legitimate_address_p): Likewise.
            * config/i386/i386.cc (ix86_legitimate_address_p): Likewise.
            * config/ia64/ia64.cc (ia64_legitimate_address_p): Likewise.
            * config/iq2000/iq2000.cc (iq2000_legitimate_address_p): Likewise.
            * config/lm32/lm32.cc (lm32_legitimate_address_p): Likewise.
            * config/loongarch/loongarch.cc (loongarch_legitimate_address_p):
            Likewise.
            * config/m32c/m32c.cc (m32c_legitimate_address_p): Likewise.
            (m32c_addr_space_legitimate_address_p): Likewise.
            * config/m32r/m32r.cc (m32r_legitimate_address_p): Likewise.
            * config/m68k/m68k.cc (m68k_legitimate_address_p): Likewise.
            * config/mcore/mcore.cc (mcore_legitimate_address_p): Likewise.
            * config/microblaze/microblaze-protos.h (tree.h): New include for
            tree_code ERROR_MARK.
            (microblaze_legitimate_address_p): Adjust with extra unnamed
            code_helper argument with default ERROR_MARK.
            * config/microblaze/microblaze.cc
(microblaze_legitimate_address_p):
            Likewise.
            * config/mips/mips.cc (mips_legitimate_address_p): Likewise.
            * config/mmix/mmix.cc (mmix_legitimate_address_p): Likewise.
            * config/mn10300/mn10300.cc (mn10300_legitimate_address_p):
Likewise.
            * config/moxie/moxie.cc (moxie_legitimate_address_p): Likewise.
            * config/msp430/msp430.cc (msp430_legitimate_address_p): Likewise.
            (msp430_addr_space_legitimate_address_p): Adjust with extra
code_helper
            argument with default ERROR_MARK and adjust the call to function
            msp430_legitimate_address_p.
            * config/nds32/nds32.cc (nds32_legitimate_address_p): Adjust with
extra
            unnamed code_helper argument with default ERROR_MARK.
            * config/nios2/nios2.cc (nios2_legitimate_address_p): Likewise.
            * config/nvptx/nvptx.cc (nvptx_legitimate_address_p): Likewise.
            * config/or1k/or1k.cc (or1k_legitimate_address_p): Likewise.
            * config/pa/pa.cc (pa_legitimate_address_p): Likewise.
            * config/pdp11/pdp11.cc (pdp11_legitimate_address_p): Likewise.
            * config/pru/pru.cc (pru_addr_space_legitimate_address_p):
Likewise.
            * config/riscv/riscv.cc (riscv_legitimate_address_p): Likewise.
            * config/rl78/rl78-protos.h (rl78_as_legitimate_address): Likewise.
            (tree.h): New include for tree_code ERROR_MARK.
            * config/rl78/rl78.cc (rl78_as_legitimate_address): Adjust with
            extra unnamed code_helper argument with default ERROR_MARK.
            * config/rs6000/rs6000.cc (rs6000_legitimate_address_p): Likewise.
            (rs6000_debug_legitimate_address_p): Adjust with extra code_helper
            argument and adjust the call to function
rs6000_legitimate_address_p.
            * config/rx/rx.cc (rx_is_legitimate_address): Adjust with extra
            unnamed code_helper argument with default ERROR_MARK.
            * config/s390/s390.cc (s390_legitimate_address_p): Likewise.
            * config/sh/sh.cc (sh_legitimate_address_p): Likewise.
            * config/sparc/sparc.cc (sparc_legitimate_address_p): Likewise.
            * config/v850/v850.cc (v850_legitimate_address_p): Likewise.
            * config/vax/vax.cc (vax_legitimate_address_p): Likewise.
            * config/visium/visium.cc (visium_legitimate_address_p): Likewise.
            * config/xtensa/xtensa.cc (xtensa_legitimate_address_p): Likewise.
            * config/stormy16/stormy16-protos.h
(xstormy16_legitimate_address_p):
            Likewise.
            (tree.h): New include for tree_code ERROR_MARK.
            * config/stormy16/stormy16.cc (xstormy16_legitimate_address_p):
            Adjust with extra unnamed code_helper argument with default
            ERROR_MARK.

  parent reply	other threads:[~2023-08-09  6:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  9:20 [Bug tree-optimization/110248] New: " linkw at gcc dot gnu.org
2023-06-14 11:45 ` [Bug tree-optimization/110248] " linkw at gcc dot gnu.org
2023-06-14 11:49 ` linkw at gcc dot gnu.org
2023-06-14 11:56 ` juzhe.zhong at rivai dot ai
2023-06-14 12:23 ` rguenth at gcc dot gnu.org
2023-06-14 12:55 ` rsandifo at gcc dot gnu.org
2023-06-14 13:08 ` rguenth at gcc dot gnu.org
2023-06-15  2:15 ` linkw at gcc dot gnu.org
2023-08-09  6:17 ` cvs-commit at gcc dot gnu.org [this message]
2023-08-09  6:17 ` cvs-commit at gcc dot gnu.org
2023-08-09  6:17 ` cvs-commit at gcc dot gnu.org
2023-08-10  2:03 ` linkw at gcc dot gnu.org
2023-08-14  8:09 ` jbglaw@lug-owl.de

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=bug-110248-4-AIJ78VKq0f@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).