aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng Xue <fxue@os.amperecomputing.com>2024-06-16 12:08:56 +0800
committerFeng Xue <fxue@os.amperecomputing.com>2024-06-20 10:35:39 +0800
commita944e57506fc64b8eede79c2405ba0b498461f0b (patch)
tree8ae4854bb1e07fe75cccf66dbc559fef1494bf6d
parent70466e6f9d9fb87f78ffe2e397ca876b380cb493 (diff)
downloadgcc-a944e57506fc64b8eede79c2405ba0b498461f0b.zip
gcc-a944e57506fc64b8eede79c2405ba0b498461f0b.tar.gz
gcc-a944e57506fc64b8eede79c2405ba0b498461f0b.tar.bz2
vect: Remove duplicated check on reduction operand
In vectorizable_reduction, one check on a reduction operand via index could be contained by another one check via pointer, so remove the former. 2024-06-16 Feng Xue <fxue@os.amperecomputing.com> gcc/ * tree-vect-loop.cc (vectorizable_reduction): Remove the duplicated check.
-rw-r--r--gcc/tree-vect-loop.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index eeb75c0..aab408d 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7815,11 +7815,9 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
"use not simple.\n");
return false;
}
- if (i == STMT_VINFO_REDUC_IDX (stmt_info))
- continue;
- /* For an IFN_COND_OP we might hit the reduction definition operand
- twice (once as definition, once as else). */
+ /* Skip reduction operands, and for an IFN_COND_OP we might hit the
+ reduction operand twice (once as definition, once as else). */
if (op.ops[i] == op.ops[STMT_VINFO_REDUC_IDX (stmt_info)])
continue;