public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112438] New: RISC-V: Failed to AVL propagation through induction variable
@ 2023-11-08  6:43 juzhe.zhong at rivai dot ai
  2023-11-08  6:58 ` [Bug target/112438] " kito at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-11-08  6:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112438
           Summary: RISC-V: Failed to AVL propagation through induction
                    variable
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juzhe.zhong at rivai dot ai
  Target Milestone: ---

void
foo (int n, int * __restrict in, int * __restrict out)
{
  for (int i = 0; i < n; i += 1)
    {
      out[i] = in[i] + i;
    }
}

ASM:

foo(int, int*, int*):
        ble     a0,zero,.L5
        csrr    a5,vlenb
        srli    a5,a5,2
        vsetvli a3,zero,e32,m1,ta,ma
        vmv.v.x v4,a5
        vid.v   v2
.L3:
        vsetvli a5,a0,e32,m1,ta,ma
        slli    a4,a5,2
        vle32.v v1,0(a1)
        sub     a0,a0,a5
        vadd.vv v1,v1,v2
        vse32.v v1,0(a2)
        add     a1,a1,a4
        vsetvli a5,zero,e32,m1,ta,ma --- > redundant
        add     a2,a2,a4
        vadd.vv v2,v2,v4
        bne     a0,zero,.L3
.L5:
        ret

It's known issue that I realized it when I was supporting AVL propagation.
Now, I find the time to support AVL propagation now.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-11-10 15:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-08  6:43 [Bug c/112438] New: RISC-V: Failed to AVL propagation through induction variable juzhe.zhong at rivai dot ai
2023-11-08  6:58 ` [Bug target/112438] " kito at gcc dot gnu.org
2023-11-08  7:00 ` kito at gcc dot gnu.org
2023-11-08  7:05 ` juzhe.zhong at rivai dot ai
2023-11-08  7:25 ` juzhe.zhong at rivai dot ai
2023-11-08  7:26 ` kito at gcc dot gnu.org
2023-11-08  7:29 ` kito at gcc dot gnu.org
2023-11-08  7:51 ` juzhe.zhong at rivai dot ai
2023-11-08  8:06 ` [Bug target/112438] RISC-V: Wrong auto-vectorization on induction variable of RVV kito at gcc dot gnu.org
2023-11-08  9:08 ` juzhe.zhong at rivai dot ai
2023-11-08  9:15 ` kito at gcc dot gnu.org
2023-11-08  9:17 ` juzhe.zhong at rivai dot ai
2023-11-08  9:20 ` kito at gcc dot gnu.org
2023-11-08 10:57 ` juzhe.zhong at rivai dot ai
2023-11-10 14:33 ` cvs-commit at gcc dot gnu.org
2023-11-10 15:16 ` juzhe.zhong at rivai dot ai

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).