diff options
author | Juzhe-Zhong <juzhe.zhong@rivai.ai> | 2023-08-22 18:51:37 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2023-08-22 22:10:25 +0800 |
commit | f4658e025424ac281dd8b7e61f798f435dbf1cab (patch) | |
tree | 6df89fa7bf24c43ed51abd0478c0657f0082a76e /gcc/rtl.h | |
parent | 2c27600fa79431576f47d55b9ed7b2f4790def67 (diff) | |
download | gcc-f4658e025424ac281dd8b7e61f798f435dbf1cab.zip gcc-f4658e025424ac281dd8b7e61f798f435dbf1cab.tar.gz gcc-f4658e025424ac281dd8b7e61f798f435dbf1cab.tar.bz2 |
VECT: Add LEN_FOLD_EXTRACT_LAST pattern
Hi, Richard and Richi.
This is the last autovec pattern I want to add for RVV (length loop control).
This patch is supposed to handled this following case:
int __attribute__ ((noinline, noclone))
condition_reduction (int *a, int min_v, int n)
{
int last = 66; /* High start value. */
for (int i = 0; i < n; i++)
if (a[i] < min_v)
last = i;
return last;
}
ARM SVE IR:
...
mask__7.11_39 = vect__4.10_37 < vect_cst__38;
_40 = loop_mask_36 & mask__7.11_39;
last_5 = .FOLD_EXTRACT_LAST (last_15, _40, vect_vec_iv_.7_32);
...
RVV IR, we want to see:
...
loop_len = SELECT_VL
mask__7.11_39 = vect__4.10_37 < vect_cst__38;
last_5 = .LEN_FOLD_EXTRACT_LAST (last_15, _40, vect_vec_iv_.7_32, loop_len, bias);
...
gcc/ChangeLog:
* doc/md.texi: Add LEN_FOLD_EXTRACT_LAST pattern.
* internal-fn.cc (fold_len_extract_direct): Ditto.
(expand_fold_len_extract_optab_fn): Ditto.
(direct_fold_len_extract_optab_supported_p): Ditto.
* internal-fn.def (LEN_FOLD_EXTRACT_LAST): Ditto.
* optabs.def (OPTAB_D): Ditto.
Diffstat (limited to 'gcc/rtl.h')
0 files changed, 0 insertions, 0 deletions