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

            Bug ID: 111765
           Summary: RISC-V: Faild to vectorize gen-vect-34.c
           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: ---

https://godbolt.org/z/17qYYKWPM

float summul(int n, float *arg1, float *arg2)
{                                                  
    int i;                                             
    float res1 = 1.0;
    for(i = 0; i < n; i++) {
      if(arg2[i]) 
        res1 *= arg1[i];
    }                                                  
    return res1;                                       
}

I found both ARM SVE and RVV failed to vectorize this case wheras X86 can
vectorize it with -mavx2.

It seems that we need some tricks on both SVE and RVV backend ?

Reply via email to