* [Bug tree-optimization/67683] Missed vectorization: shifts of an induction variable
2015-09-22 17:21 [Bug tree-optimization/67683] New: Missed vectorization: shifts of an induction variable alalaw01 at gcc dot gnu.org
@ 2015-09-23 8:16 ` rguenth at gcc dot gnu.org
2015-10-06 15:15 ` alalaw01 at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-23 8:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67683
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-09-23
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is the unsupported induction (the PHI) of val
<bb 5>:
# val_16 = PHI <52719(4), val_11(7)>
# i_17 = PHI <0(4), i_12(7)>
_6 = (sizetype) i_17;
_8 = data_7(D) + _6;
_9 = (unsigned char) val_16;
*_8 = _9;
val_11 = val_16 >> 1;
i_12 = i_17 + 1;
if (max_5(D) > i_12)
SCEV already fails to analyze the evolution of val_16 so it doesn't appear
as "induction" to the vectorizer. Reductions with shifts are not handled
either (but reduction uses inside the loop are not supported by the vectorizer
anyway).
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/67683] Missed vectorization: shifts of an induction variable
2015-09-22 17:21 [Bug tree-optimization/67683] New: Missed vectorization: shifts of an induction variable alalaw01 at gcc dot gnu.org
2015-09-23 8:16 ` [Bug tree-optimization/67683] " rguenth at gcc dot gnu.org
@ 2015-10-06 15:15 ` alalaw01 at gcc dot gnu.org
2015-10-07 8:05 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: alalaw01 at gcc dot gnu.org @ 2015-10-06 15:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67683
alalaw01 at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=35226
--- Comment #2 from alalaw01 at gcc dot gnu.org ---
Is there a way to do this kind of thing other than extending polynomial_chrec's
to understand operations other than addition ? Whilst beneficial, that looks to
be quite a large task.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/67683] Missed vectorization: shifts of an induction variable
2015-09-22 17:21 [Bug tree-optimization/67683] New: Missed vectorization: shifts of an induction variable alalaw01 at gcc dot gnu.org
2015-09-23 8:16 ` [Bug tree-optimization/67683] " rguenth at gcc dot gnu.org
2015-10-06 15:15 ` alalaw01 at gcc dot gnu.org
@ 2015-10-07 8:05 ` rguenth at gcc dot gnu.org
2024-03-18 7:29 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-07 8:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67683
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Right shifts are divisions so the result isn't an affine evolution.
Yes, you could enhance the vectorizer to not rely on scalar evolutions (only)
for reduction detection.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/67683] Missed vectorization: shifts of an induction variable
2015-09-22 17:21 [Bug tree-optimization/67683] New: Missed vectorization: shifts of an induction variable alalaw01 at gcc dot gnu.org
` (2 preceding siblings ...)
2015-10-07 8:05 ` rguenth at gcc dot gnu.org
@ 2024-03-18 7:29 ` pinskia at gcc dot gnu.org
2024-03-18 7:36 ` pinskia at gcc dot gnu.org
2024-03-18 9:16 ` liuhongt at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-18 7:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67683
Bug 67683 depends on bug 35226, which changed state.
Bug 35226 Summary: Induction with multiplication are not vectorized
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35226
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/67683] Missed vectorization: shifts of an induction variable
2015-09-22 17:21 [Bug tree-optimization/67683] New: Missed vectorization: shifts of an induction variable alalaw01 at gcc dot gnu.org
` (3 preceding siblings ...)
2024-03-18 7:29 ` pinskia at gcc dot gnu.org
@ 2024-03-18 7:36 ` pinskia at gcc dot gnu.org
2024-03-18 9:16 ` liuhongt at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-18 7:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67683
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
/app/example.cpp:5:20: note: vect_is_simple_use: operand # RANGE [irange]
short unsigned int [0, 2047][3294, 3294][6589, 6589][13179, 13179][26359,
26359][52719, 52719]
val_16 = PHI <val_11(6), 52719(5)>, type of def: induction
We detect it now.
But then it is still not vectorized ...
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/67683] Missed vectorization: shifts of an induction variable
2015-09-22 17:21 [Bug tree-optimization/67683] New: Missed vectorization: shifts of an induction variable alalaw01 at gcc dot gnu.org
` (4 preceding siblings ...)
2024-03-18 7:36 ` pinskia at gcc dot gnu.org
@ 2024-03-18 9:16 ` liuhongt at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-03-18 9:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67683
Hongtao Liu <liuhongt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |liuhongt at gcc dot gnu.org
--- Comment #6 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #5)
> /app/example.cpp:5:20: note: vect_is_simple_use: operand # RANGE [irange]
> short unsigned int [0, 2047][3294, 3294][6589, 6589][13179, 13179][26359,
> 26359][52719, 52719]
> val_16 = PHI <val_11(6), 52719(5)>, type of def: induction
>
> We detect it now.
> But then it is still not vectorized ...
We don't know how to peel for variable niter, there could be UD if we peel it
like val(epilogue) = val >> (max / vf) * vf.
^ permalink raw reply [flat|nested] 7+ messages in thread