]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end: refactor WIDEN_SUM_EXPR into convert optab [PR122069]
authorTamar Christina <tamar.christina@arm.com>
Sat, 18 Oct 2025 07:18:14 +0000 (08:18 +0100)
committerTamar Christina <tamar.christina@arm.com>
Sat, 18 Oct 2025 07:24:16 +0000 (08:24 +0100)
commit2bb6a8c4f9bfe3aa37b5f82ade4f2bc8a89d107d
treee54f5bbaad8ad1e6b8babd9465bc9cabc460099a
parent2c1949bf152f8fcadb0ef7a44113c41d18724691
middle-end: refactor WIDEN_SUM_EXPR into convert optab [PR122069]

This patch changes the widen_[us]sum optabs into a convert optabs such that
targets and specify more than one conversion.

Following this patch are patches rewriting all targets using this change.

While working on this I noticed that the pattern does miss some cases it
could handle if it tried multiple attempts. e.g. if the promotion is from
qi to si, and the target doesn't have this, it should try hi -> si.

But I'm leaving that for now.

gcc/ChangeLog:

PR middle-end/122069
* doc/md.texi (widen_ssum@var{n}@var{m}3, widen_usum@var{n}@var{m}3):
Update docs.
* optabs.cc (expand_widen_pattern_expr): Add WIDEN_SUM_EXPR as widening.
* optabs.def (ssum_widen_optab, usum_widen_optab): Convert from direct
to a conversion optab.
* tree-vect-patterns.cc (vect_recog_widen_sum_pattern): Change
vect_supportable_direct_optab_p into vect_supportable_conv_optab_p.
gcc/doc/md.texi
gcc/optabs.cc
gcc/optabs.def
gcc/tree-vect-patterns.cc