]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vect: Remove duplicated check on reduction operand
authorFeng Xue <fxue@os.amperecomputing.com>
Sun, 16 Jun 2024 04:08:56 +0000 (12:08 +0800)
committerFeng Xue <fxue@os.amperecomputing.com>
Thu, 20 Jun 2024 02:35:39 +0000 (10:35 +0800)
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.

gcc/tree-vect-loop.cc

index eeb75c09e91aaf5f6cdd119e0b29b452f99b915f..aab408d1019db78042e81c1d066638362970152a 100644 (file)
@@ -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;