Skip to content
Snippets Groups Projects
Commit cac9d2d2 authored by Richard Biener's avatar Richard Biener
Browse files

tree-optimization/113078 - conditional subtraction reduction vectorization

When if-conversion was changed to use .COND_ADD/SUB for conditional
reduction it was forgotten to update reduction path handling to
canonicalize .COND_SUB to .COND_ADD for vectorizable_reduction
similar to what we do for MINUS_EXPR.  The following adds this
and testcases exercising this at runtime and looking for the
appropriate masked subtraction in the vectorized code on x86.

	PR tree-optimization/113078
	* tree-vect-loop.cc (check_reduction_path): Canonicalize
	.COND_SUB to .COND_ADD.

	* gcc.dg/vect/vect-reduc-cond-sub.c: New testcase.
	* gcc.target/i386/vect-pr113078.c: Likewise.
parent f8a70fb2
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment