aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2023-06-26 13:48:35 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2023-06-26 13:48:35 +0100
commit9302b0743b366037379af0568534c23ab597b4d4 (patch)
tree331cf92c11545114cbe411c1f4a4bcac358ccd87 /gcc
parent53d6f57c1b20c6da52aefce737fb7d5263686ba3 (diff)
downloadgcc-9302b0743b366037379af0568534c23ab597b4d4.zip
gcc-9302b0743b366037379af0568534c23ab597b4d4.tar.gz
gcc-9302b0743b366037379af0568534c23ab597b4d4.tar.bz2
vect: Cost intermediate conversions
g:6f19cf7526168f8 extended N-vector to N-vector conversions to handle cases where an intermediate integer extension or truncation is needed. This patch adjusts the cost to account for these intermediate conversions. gcc/ * tree-vect-stmts.cc (vectorizable_conversion): Take multi_step_cvt into account when costing non-widening/truncating conversions.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-stmts.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index bf61461..b31971e 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -5478,8 +5478,9 @@ vectorizable_conversion (vec_info *vinfo,
if (modifier == NONE)
{
STMT_VINFO_TYPE (stmt_info) = type_conversion_vec_info_type;
- vect_model_simple_cost (vinfo, stmt_info, ncopies, dt, ndts, slp_node,
- cost_vec);
+ vect_model_simple_cost (vinfo, stmt_info,
+ ncopies * (1 + multi_step_cvt),
+ dt, ndts, slp_node, cost_vec);
}
else if (modifier == NARROW_SRC || modifier == NARROW_DST)
{