From: Victor Do Nascimento
<[email protected]>
This re-categorization of reductions for uncounted loops involving
reductions leads to the correct calling of
`vect_create_epilog_for_reduction' function.
gcc/ChangeLog:
* tree-vect-loop.cc (vectorizable_reduction): Reclassify
uncounted-loop VECT_REDUC_INFO_TYPE as TREE_CODE_REDUCTION.
---
gcc/tree-vect-loop.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 901903cfbea..3b038169c95 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7426,8 +7426,9 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
"supported.\n");
return false;
}
- VECT_REDUC_INFO_TYPE (reduc_info)
- = reduction_type = FOLD_LEFT_REDUCTION;
+ VECT_REDUC_INFO_TYPE (reduc_info) = reduction_type
+ = LOOP_VINFO_NITERS_UNCOUNTED_P (loop_vinfo) ? TREE_CODE_REDUCTION
+ : FOLD_LEFT_REDUCTION;
}
else if (!commutative_binary_op_p (orig_code, op.type)
|| !associative_binary_op_p (orig_code, op.type))
--
2.43.0