llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.52k stars 11.79k forks source link

[sve] gcc generate better code for a search loop #64294

Open zhongsir1 opened 1 year ago

zhongsir1 commented 1 year ago

test: https://godbolt.org/z/qjzhsY8c1

int s331(void)
{
// search loops
  int j = -1;
  for (int i = 0; i < LEN_1D; i++) {
    if (a[i] < (real_t)0.) {
      j = i;
    }
  }
  return j+1;
}
llvmbot commented 1 year ago

@llvm/issue-subscribers-backend-aarch64

davemgreen commented 1 year ago

This may be addressed with https://reviews.llvm.org/D143465 or https://reviews.llvm.org/D150851 or one of the related reviews.