public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/112538] New: [RISC-V] Failed to disable V-ext autovectorization using the '--param riscv-autovec-preference=none'
@ 2023-11-15  4:41 mumuxi_ll at outlook dot com
  2023-11-15  5:23 ` [Bug target/112538] " juzhe.zhong at rivai dot ai
  2023-11-15  5:53 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: mumuxi_ll at outlook dot com @ 2023-11-15  4:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112538
           Summary: [RISC-V] Failed to disable V-ext autovectorization
                    using the '--param riscv-autovec-preference=none'
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mumuxi_ll at outlook dot com
  Target Milestone: ---

Here is my test case:

```
#include <string.h>

typedef char    Str_30 [31];

Str_30          Str_2_Loc;

void foo(void)
{
    strcpy(Str_2_Loc, "DHRYSTONE PROGRAM");
}
```

Compiled with riscv64-unknown-elf-gcc -march=rv32imafdc_zve32f -mabi=ilp32d -S
rvv_autovec_bug.c --param riscv-autovec-preference=none

The result is:

        .string "DHRYSTONE PROGRAM"
        .text
        .align  1
        .globl  foo
        .type   foo, @function
foo:
        addi    sp,sp,-16
        sw      ra,12(sp)
        sw      s0,8(sp)
        addi    s0,sp,16
        lui     a5,%hi(Str_2_Loc)
        addi    a3,a5,%lo(Str_2_Loc)
        lui     a5,%hi(.LC0)
        addi    a4,a5,%lo(.LC0)
        mv      a5,a3
        vsetivli        zero,9,e16,m8,ta,ma
        vle16.v v8,0(a4)
        vsetivli        zero,9,e16,m8,ta,ma
        vse16.v v8,0(a5)
        nop
        lw      ra,12(sp)
        lw      s0,8(sp)
        addi    sp,sp,16
        jr      ra

It still generates the v-ext instructions automatically, which seems that the
"--param riscv-autovec-preference=none" did not work.

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

* [Bug target/112538] [RISC-V] Failed to disable V-ext autovectorization using the '--param riscv-autovec-preference=none'
  2023-11-15  4:41 [Bug target/112538] New: [RISC-V] Failed to disable V-ext autovectorization using the '--param riscv-autovec-preference=none' mumuxi_ll at outlook dot com
@ 2023-11-15  5:23 ` juzhe.zhong at rivai dot ai
  2023-11-15  5:53 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-11-15  5:23 UTC (permalink / raw)
  To: gcc-bugs

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

JuzheZhong <juzhe.zhong at rivai dot ai> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |juzhe.zhong at rivai dot ai

--- Comment #1 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
Duplicate bug of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112537

It generates vector codes since it is lower int __builtin_memcpy

https://godbolt.org/z/f36feoW6x

Current expanding memcpy into RVV by default as long as TARGET_VECTOR is true.

More details see expand_block_move in riscv-string.cc

Maybe you need to add 

  if (!flag_tree_vectorize)
    return false;

in expand_block_move .

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

* [Bug target/112538] [RISC-V] Failed to disable V-ext autovectorization using the '--param riscv-autovec-preference=none'
  2023-11-15  4:41 [Bug target/112538] New: [RISC-V] Failed to disable V-ext autovectorization using the '--param riscv-autovec-preference=none' mumuxi_ll at outlook dot com
  2023-11-15  5:23 ` [Bug target/112538] " juzhe.zhong at rivai dot ai
@ 2023-11-15  5:53 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-15  5:53 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup.

*** This bug has been marked as a duplicate of bug 112537 ***

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15  4:41 [Bug target/112538] New: [RISC-V] Failed to disable V-ext autovectorization using the '--param riscv-autovec-preference=none' mumuxi_ll at outlook dot com
2023-11-15  5:23 ` [Bug target/112538] " juzhe.zhong at rivai dot ai
2023-11-15  5:53 ` pinskia at gcc dot gnu.org

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