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 target/113112] RISC-V: Dynamic LMUL feature stabilization for GCC-14 release
Date: Wed, 03 Jan 2024 09:21:11 +0000	[thread overview]
Message-ID: <bug-113112-4-hHYcUciqmj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113112-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pan Li <panli@gcc.gnu.org>:

https://gcc.gnu.org/g:a43bd8255451227fc1cd3601b1f0265b21fafada

commit r14-6889-ga43bd8255451227fc1cd3601b1f0265b21fafada
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Tue Jan 2 11:37:43 2024 +0800

    RISC-V: Make liveness be aware of rgroup number of LENS[dynamic LMUL]

    This patch fixes the following situation:
    vl4re16.v       v12,0(a5)
    ...
    vl4re16.v       v16,0(a3)
    vs4r.v  v12,0(a5)
    ...
    vl4re16.v       v4,0(a0)
    vs4r.v  v16,0(a3)
    ...
    vsetvli a3,zero,e16,m4,ta,ma
    ...
    vmv.v.x v8,t6
    vmsgeu.vv       v2,v16,v8
    vsub.vv v16,v16,v8
    vs4r.v  v16,0(a5)
    ...
    vs4r.v  v4,0(a0)
    vmsgeu.vv       v1,v4,v8
    ...
    vsub.vv v4,v4,v8
    slli    a6,a4,2
    vs4r.v  v4,0(a5)
    ...
    vsub.vv v4,v12,v8
    vmsgeu.vv       v3,v12,v8
    vs4r.v  v4,0(a5)
    ...

    There are many spills which are 'vs4r.v'.  The root cause is that we don't
count
    vector REG liveness referencing the rgroup controls.

    _29 = _25->iatom[0]; is transformed into the following vect statement with
4 different loop_len (loop_len_74, loop_len_75, loop_len_76, loop_len_77).

      vect__29.11_78 = .MASK_LEN_LOAD (vectp_sb.9_72, 32B, { -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, loop_len_74, 0);
      vect__29.12_80 = .MASK_LEN_LOAD (vectp_sb.9_79, 32B, { -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, loop_len_75, 0);
      vect__29.13_82 = .MASK_LEN_LOAD (vectp_sb.9_81, 32B, { -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, loop_len_76, 0);
      vect__29.14_84 = .MASK_LEN_LOAD (vectp_sb.9_83, 32B, { -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, loop_len_77, 0);

    which are the LENS number (LOOP_VINFO_LENS (loop_vinfo).length ()).

    Count liveness according to LOOP_VINFO_LENS (loop_vinfo).length () to
compute liveness more accurately:

    vsetivli        zero,8,e16,m1,ta,ma
    vmsgeu.vi       v19,v14,8
    vadd.vi v18,v14,-8
    vmsgeu.vi       v17,v1,8
    vadd.vi v16,v1,-8
    vlm.v   v15,0(a5)
    ...

    Tested no regression, ok for trunk ?

            PR target/113112

    gcc/ChangeLog:

            * config/riscv/riscv-vector-costs.cc (compute_nregs_for_mode): Add
rgroup info.
            (max_number_of_live_regs): Ditto.
            (has_unexpected_spills_p): Ditto.

    gcc/testsuite/ChangeLog:

            * gcc.dg/vect/costmodel/riscv/rvv/pr113112-5.c: New test.

      parent reply	other threads:[~2024-01-03  9:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22  9:04 [Bug c/113112] New: " juzhe.zhong at rivai dot ai
2023-12-23  0:59 ` [Bug target/113112] " cvs-commit at gcc dot gnu.org
2023-12-26  9:29 ` cvs-commit at gcc dot gnu.org
2023-12-27  9:19 ` cvs-commit at gcc dot gnu.org
2024-01-02  0:23 ` cvs-commit at gcc dot gnu.org
2024-01-03  9:21 ` cvs-commit at gcc dot gnu.org [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=bug-113112-4-hHYcUciqmj@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).