aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2021-03-26 16:08:37 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2021-03-26 16:08:37 +0000
commite4180ab2fea0d3e8010f23b5e73095ac13cedafa (patch)
treec8c8314edec0ca3007c0215746407e06c998c742 /gcc
parent99f94ae5018e915d0c1db1b6d4110d68bc4d242e (diff)
downloadgcc-e4180ab2fea0d3e8010f23b5e73095ac13cedafa.zip
gcc-e4180ab2fea0d3e8010f23b5e73095ac13cedafa.tar.gz
gcc-e4180ab2fea0d3e8010f23b5e73095ac13cedafa.tar.bz2
aarch64: Ignore inductions when costing vector code
In practice it seems to be better not to cost a vector induction. The scalar code generally needs the same induction but doesn't cost it, making an apples-for-apples comparison harder. Most inductions also have a low latency and their cost usually gets hidden by other operations. Like with the previous patches, this one only becomes active if a CPU selects use_new_vector_costs. It should therefore have a very low impact on other CPUs. gcc/ * config/aarch64/aarch64.c (aarch64_detect_vector_stmt_subtype): Assume a zero cost for induction phis.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/aarch64/aarch64.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index e97e71b..6d18d82 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -14541,6 +14541,12 @@ aarch64_detect_vector_stmt_subtype (vec_info *vinfo, vect_cost_for_stmt kind,
if (aarch64_sve_mode_p (TYPE_MODE (vectype)))
sve_costs = aarch64_tune_params.vec_costs->sve;
+ /* It's generally better to avoid costing inductions, since the induction
+ will usually be hidden by other operations. This is particularly true
+ for things like COND_REDUCTIONS. */
+ if (is_a<gphi *> (stmt_info->stmt))
+ return 0;
+
/* Detect cases in which vec_to_scalar is describing the extraction of a
vector element in preparation for a scalar store. The store itself is
costed separately. */