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/113209] [14] RISC-V rv64gcv_zvl256b vector: Runtime mismatch with rv64gc
Date: Thu, 04 Jan 2024 00:33:22 +0000	[thread overview]
Message-ID: <bug-113209-4-eqcT5D1aP2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113209-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 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:4a0a8dc1b88408222b88e10278017189f6144602

commit r14-6902-g4a0a8dc1b88408222b88e10278017189f6144602
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Thu Jan 4 06:38:43 2024 +0800

    RISC-V: Fix bug of earliest fusion for infinite loop[VSETVL PASS]

    As PR113206 and PR113209, the bugs happens on the following situation:

            li      a4,32
            ...
            vsetvli zero,a4,e8,m8,ta,ma
            ...
            slliw   a4,a3,24
            sraiw   a4,a4,24
            bge     a3,a1,.L8
            sb      a4,%lo(e)(a0)
            vsetvli zero,a4,e8,m8,ta,ma  --> a4 is polluted value not the
expected "32".
            ...
    .L7:
            j       .L7 ---> infinite loop.

    The root cause is that infinite loop confuse earliest computation and let
earliest fusion
    happens on unexpected place.

    Disable blocks that belong to infinite loop to fix this bug since applying
ealiest LCM fusion
    on infinite loop seems quite complicated and we don't see any benefits.

    Note that disabling earliest fusion on infinite loops doesn't hurt the
vsetvli performance,
    instead, it does improve codegen of some cases.

    Tested on both RV32 and RV64 no regression.

            PR target/113206
            PR target/113209

    gcc/ChangeLog:

            * config/riscv/riscv-vsetvl.cc (invalid_opt_bb_p): New function.
            (pre_vsetvl::compute_lcm_local_properties): Disable earliest fusion
on
            blocks belong to infinite loop.
            (pre_vsetvl::emit_vsetvl): Remove fake edges.
            * config/riscv/t-riscv: Add a new include file.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/vsetvl/avl_single-23.c: Adapt test.
            * gcc.target/riscv/rvv/vsetvl/vlmax_call-1.c: Robostify test.
            * gcc.target/riscv/rvv/vsetvl/vlmax_call-2.c: Ditto.
            * gcc.target/riscv/rvv/vsetvl/vlmax_call-3.c: Ditto.
            * gcc.target/riscv/rvv/vsetvl/vlmax_conflict-5.c: Ditto.
            * gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-1.c: Ditto.
            * gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-2.c: Ditto.
            * gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-3.c: Ditto.
            * gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-4.c: Ditto.
            * gcc.target/riscv/rvv/vsetvl/vlmax_single_vtype-5.c: Ditto.
            * gcc.target/riscv/rvv/autovec/pr113206-1.c: New test.
            * gcc.target/riscv/rvv/autovec/pr113206-2.c: New test.
            * gcc.target/riscv/rvv/autovec/pr113209.c: New test.

  reply	other threads:[~2024-01-04  0:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02 21:48 [Bug target/113209] New: " patrick at rivosinc dot com
2024-01-04  0:33 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-04  1:37 ` [Bug target/113209] " patrick at rivosinc dot com

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-113209-4-eqcT5D1aP2@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).