Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/extract_last-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d -mrvv-vector-bits=zvl -fno-vect-cost-model -fdump-tree-optimized" } */
3
4 #define N 32
5
6 /* Simple condition reduction. */
7
8 int __attribute__ ((noinline, noclone))
9 condition_reduction (int *a, int min_v)
10 {
11 int last = 66; /* High start value. */
12
13 for (int i = 0; i < N; i++)
14 if (a[i] < min_v)
15 last = i;
16
17 return last;
18 }
19
20 /* { dg-final { scan-tree-dump "\.LEN_FOLD_EXTRACT_LAST" "optimized" } } */