diff options
author | Ju-Zhe Zhong <juzhe.zhong@rivai.ai> | 2023-07-23 12:23:33 +0800 |
---|---|---|
committer | Lehua Ding <lehua.ding@rivai.ai> | 2023-07-24 16:22:30 +0800 |
commit | 42b17d00c33dd9994dee973c001d85dc09b79b24 (patch) | |
tree | adf8a0e1ec69f261df6e55babc49de86f588f726 /gcc/tree-vectorizer.h | |
parent | 50b5feaa94c26d01fed13f1119f025ae2bc75d2b (diff) | |
download | gcc-42b17d00c33dd9994dee973c001d85dc09b79b24.zip gcc-42b17d00c33dd9994dee973c001d85dc09b79b24.tar.gz gcc-42b17d00c33dd9994dee973c001d85dc09b79b24.tar.bz2 |
VECT: Support floating-point in-order reduction for length loop control
Hi, Richard and Richi.
This patch support floating-point in-order reduction for loop length control.
Consider this following case:
float foo (float *__restrict a, int n)
{
float result = 1.0;
for (int i = 0; i < n; i++)
result += a[i];
return result;
}
When compile with **NO** -ffast-math on ARM SVE, we will end up with:
loop_mask = WHILE_ULT
result = MASK_FOLD_LEFT_PLUS (...loop_mask...)
For RVV, we don't use length loop control instead of mask:
So, with this patch, we expect to see:
loop_len = SELECT_VL
result = MASK_LEN_FOLD_LEFT_PLUS (...loop_len...)
gcc/ChangeLog:
* tree-vect-loop.cc (get_masked_reduction_fn): Add mask_len_fold_left_plus.
(vectorize_fold_left_reduction): Ditto.
(vectorizable_reduction): Ditto.
(vect_transform_reduction): Ditto.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions