diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2023-05-24 00:05:01 -0500 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2023-05-24 00:05:01 -0500 |
commit | e55c134ebeef2fa23ad5f4d8afa36b5949b2852c (patch) | |
tree | d76abadd94081f90e744dfb55a4128c96ade009c /gcc/gimple-range.cc | |
parent | e0600a02fc3eda109d12bdfccf1408c5bf2994db (diff) | |
download | gcc-e55c134ebeef2fa23ad5f4d8afa36b5949b2852c.zip gcc-e55c134ebeef2fa23ad5f4d8afa36b5949b2852c.tar.gz gcc-e55c134ebeef2fa23ad5f4d8afa36b5949b2852c.tar.bz2 |
vect: Enhance cost evaluation in vect_transform_slp_perm_load_1
Following Richi's suggestion in [1], I'm working on deferring
cost evaluation next to the transformation, this patch is
to enhance function vect_transform_slp_perm_load_1 which
could under-cost for vector permutation, since the costing
doesn't try to consider nvectors_per_build, it's inconsistent
with the transformation part.
Basically it changes the below
if (index == count)
{
if (!noop_p)
{
// A ...
// ++*n_perms;
if (!analyze_only)
{
// B1 ...
// B2 ...
for ...
// B3 building VEC_PERM_EXPR
}
}
else if (!analyze_only)
{
// no B2 since no any further uses here.
for ...
// B4 building nothing
}
// B5 ...
}
to:
if (index == count)
{
if (!noop_p)
{
// A ...
if (!analyze_only)
// B1 ...
// B2 ... (trivial computations during analyze_only or not)
for ...
{
// now n_perms is consistent with building VEC_PERM_EXPR
// ++*n_perms;
if (analyze_only)
continue;
// B3 building VEC_PERM_EXPR
}
}
else if (!analyze_only)
{
// no B2 since no any further uses here.
for ...
// B4 building nothing
}
// B5 ...
}
[1] https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563624.html
gcc/ChangeLog:
* tree-vect-slp.cc (vect_transform_slp_perm_load_1): Adjust the
calculation on n_perms by considering nvectors_per_build.
gcc/testsuite/ChangeLog:
* gcc.dg/vect/costmodel/ppc/costmodel-slp-perm.c: New test.
Diffstat (limited to 'gcc/gimple-range.cc')
0 files changed, 0 insertions, 0 deletions