Attached simple test-case extracted from important suite is not vectorized even if 'pragma omp simd' is used since ifcvt_repair_bool_pattern does not remove all multiple uses and we get the following message: test.c:11:14: note: bit-precision arithmetic not supported. test.c:11:14: note: not vectorized: relevant stmt not supported: _ifc__90 = x1_7 >= 0; The problem is that statement splitting may introduce other multiple predicate uses and iterative algorithm should be used. I attached simple fix which cures the problem.
Created attachment 34548 [details] test-case to reproduce. Need to compile this test on x86 with option -O3 -fopenmp -march=core-avx2
Created attachment 34551 [details] proposed patch Patch to cure vectorization issue.
Author: ienkovich Date: Thu Jan 29 13:52:28 2015 New Revision: 220248 URL: https://gcc.gnu.org/viewcvs?rev=220248&root=gcc&view=rev Log: gcc/ PR tree-optimization/64746 * tree-if-conv.c (mask_exists): New function. (predicate_mem_writes): Save created mask with given size for further use. (stmt_is_root_of_bool_pattern): Remove argument VAR and store to it. (ifcvt_repair_bool_pattern): Collect all statements that are root of bool pattern and use iterative algorithm to remove multiple uses of predicates, display number of required iterations. gcc/testsuite/ PR tree-optimization/64746 * gcc.target/i386/avx2-vect-aggressive-1.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/avx2-vect-aggressive-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-if-conv.c
Can the bug be marked as resolved?