Bug 64746 - Loop with nested load/stores is not vectorized using aggressive if-conversion.
Summary: Loop with nested load/stores is not vectorized using aggressive if-conversion.
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks: vectorizer
  Show dependency treegraph
 
Reported: 2015-01-23 13:09 UTC by Yuri Rumyantsev
Modified: 2021-10-01 03:21 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test-case to reproduce. (240 bytes, text/plain)
2015-01-23 13:12 UTC, Yuri Rumyantsev
Details
proposed patch (2.08 KB, patch)
2015-01-23 13:14 UTC, Yuri Rumyantsev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Rumyantsev 2015-01-23 13:09:05 UTC
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.
Comment 1 Yuri Rumyantsev 2015-01-23 13:12:25 UTC
Created attachment 34548 [details]
test-case to reproduce.

Need to compile this test on x86 with option
  -O3 -fopenmp -march=core-avx2
Comment 2 Yuri Rumyantsev 2015-01-23 13:14:14 UTC
Created attachment 34551 [details]
proposed patch

Patch to cure vectorization issue.
Comment 3 Ilya Enkovich 2015-01-29 13:53:01 UTC
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
Comment 4 Martin Liška 2018-11-19 13:26:49 UTC
Can the bug be marked as resolved?