Commit 47d3fdb2 by Richard Biener Committed by Richard Biener

re PR tree-optimization/69907 (wrong code at -O3 on x86_64-linux-gnu)

2016-02-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/69907
	* tree-vect-stmts.c (vectorizable_load): Check for gaps at the
	end of permutations for BB vectorization.

	* gcc.dg/vect/bb-slp-pr69907.c: New testcase.
	* gcc.dg/vect/bb-slp-34.c: XFAIL.
	* gcc.dg/vect/bb-slp-pr68892.c: Likewise.

From-SVN: r233655
parent dab73e73
2016-02-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/69907
* tree-vect-stmts.c (vectorizable_load): Check for gaps at the
end of permutations for BB vectorization.
2016-02-24 Christian Bruel <christian.bruel@st.com>
* config/arm/arm-c.c (arm_option_override): Initialize
......
2016-02-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/69907
* gcc.dg/vect/bb-slp-pr69907.c: New testcase.
* gcc.dg/vect/bb-slp-34.c: XFAIL.
* gcc.dg/vect/bb-slp-pr68892.c: Likewise.
2016-02-24 Christian Bruel <christian.bruel@st.com>
* gcc.target/arm/pragma_cpp_fma.c: New test.
......
......@@ -32,4 +32,5 @@ int main()
return 0;
}
/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" { target vect_perm } } } */
/* ??? XFAILed because we access "excess" elements with the permutation. */
/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" { target vect_perm xfail *-*-* } } } */
......@@ -13,5 +13,7 @@ void foo(void)
b[3] = a[3][0];
}
/* { dg-final { scan-tree-dump "not profitable" "slp2" } } */
/* ??? The profitability check is not reached because we give up on the
gaps we access earlier. */
/* { dg-final { scan-tree-dump "not profitable" "slp2" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "Basic block will be vectorized" 0 "slp2" } } */
/* { dg-do compile } */
/* { dg-additional-options "-O3" } */
/* { dg-require-effective-target vect_unpack } */
void foo(unsigned *p1, unsigned short *p2)
{
int n;
for (n = 0; n < 320; n++)
p1[n] = p2[n * 2];
}
/* { dg-final { scan-tree-dump "BB vectorization with gaps at the end of a load is not supported" "slp1" } } */
......@@ -6395,6 +6395,19 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
slp_perm = true;
group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
/* ??? The following is overly pessimistic (as well as the loop
case above) in the case we can statically determine the excess
elements loaded are within the bounds of a decl that is accessed.
Likewise for BB vectorizations using masked loads is a possibility. */
if (bb_vinfo && slp_perm && group_size % nunits != 0)
{
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"BB vectorization with gaps at the end of a load "
"is not supported\n");
return false;
}
if (!slp
&& !PURE_SLP_STMT (stmt_info)
&& !STMT_VINFO_STRIDED_P (stmt_info))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment