public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/62012] New: Loop is not vectorized after function inlining (SCEV)
@ 2014-08-04 14:48 ysrumyan at gmail dot com
2014-08-04 14:51 ` [Bug tree-optimization/62012] " ysrumyan at gmail dot com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: ysrumyan at gmail dot com @ 2014-08-04 14:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62012
Bug ID: 62012
Summary: Loop is not vectorized after function inlining (SCEV)
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: ysrumyan at gmail dot com
We noticed that for one important benchmark using '-lto' options leads to
performance degradation which is caused by not-vectorizing the hottest loop
after function inlining. I can able to reproduce this deficiency using simple
test-case:
if we passed class by reference to function (it need to be compiled with
-DPARAM macros) loop is vectorized:
g++ -Ofast -m64 -march=core-avx2 -c test.cpp -fdump-tree-vect-details -fopenmp
-DPARAM; grep 'note: vectorized' test.cpp.114t.vect
test.cpp:45:1: note: vectorized 1 loops in function.
But if we compile it without macros we get:
g++ -Ofast -m64 -march=core-avx2 -c test.cpp -fdump-tree-vect-details
-fopenmp; grep 'note: vectorized' test.cpp.114t.vect
test.cpp:45:1: note: vectorized 0 loops in function.
It looks like SCEV issue.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/62012] Loop is not vectorized after function inlining (SCEV)
2014-08-04 14:48 [Bug tree-optimization/62012] New: Loop is not vectorized after function inlining (SCEV) ysrumyan at gmail dot com
@ 2014-08-04 14:51 ` ysrumyan at gmail dot com
2014-09-08 10:59 ` ysrumyan at gmail dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ysrumyan at gmail dot com @ 2014-08-04 14:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62012
--- Comment #1 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
Created attachment 33241
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33241&action=edit
test-case to reproduce
Options to compile are:
-Ofast -m64 -march=core-avx2 -fopenmp
and macros -DPARAM can be used to get vectorizable version of test.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/62012] Loop is not vectorized after function inlining (SCEV)
2014-08-04 14:48 [Bug tree-optimization/62012] New: Loop is not vectorized after function inlining (SCEV) ysrumyan at gmail dot com
2014-08-04 14:51 ` [Bug tree-optimization/62012] " ysrumyan at gmail dot com
@ 2014-09-08 10:59 ` ysrumyan at gmail dot com
2014-09-08 11:29 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ysrumyan at gmail dot com @ 2014-09-08 10:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62012
--- Comment #2 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
Any updates?
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/62012] Loop is not vectorized after function inlining (SCEV)
2014-08-04 14:48 [Bug tree-optimization/62012] New: Loop is not vectorized after function inlining (SCEV) ysrumyan at gmail dot com
2014-08-04 14:51 ` [Bug tree-optimization/62012] " ysrumyan at gmail dot com
2014-09-08 10:59 ` ysrumyan at gmail dot com
@ 2014-09-08 11:29 ` rguenth at gcc dot gnu.org
2014-09-09 13:57 ` ysrumyan at gmail dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-09-08 11:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62012
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2014-09-08
Ever confirmed|0 |1
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it's independend of LTO.
Confirmed. We have
_28 = &MEM[(struct Array *)&fa + 256B].a[0] + _3;
*_28 = u_23;
which SCEV messes up because it ends up with
(instantiate_scev
(instantiate_below = 4)
(evolution_loop = 1)
(chrec = &MEM[(struct Array *)&fa + 256B].a[0])
(res = &MEM[(struct Array *)&fa + 256B].a[0]))
(instantiate_scev
(instantiate_below = 4)
(evolution_loop = 1)
(chrec = {(long unsigned int) first_6(D) * 4, +, 4}_1)
(res = {(long unsigned int) first_6(D) * 4, +, 4}_1))
(set_scalar_evolution
instantiated_below = 4
(scalar = _13)
(scalar_evolution = {&MEM[(struct Array *)&fa + 256B].a[(sizetype)
first_6(D)], +, 4}_1))
)
failed: evolution of base is not affine.
Not sure why it thinks that.
Btw, on trunk we now vectorize this just fine probably because of the fix
for PR63148 which avoids moving first_6 * 4 inside the array-ref and we
get
(scalar_evolution = {&MEM[(struct Array *)&fa + 256B].a[0] + (sizetype)
((long unsigned int) first_6(D) * 4), +, 4}_1))
)
success.
instead.
So - can you re-check please?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/62012] Loop is not vectorized after function inlining (SCEV)
2014-08-04 14:48 [Bug tree-optimization/62012] New: Loop is not vectorized after function inlining (SCEV) ysrumyan at gmail dot com
` (2 preceding siblings ...)
2014-09-08 11:29 ` rguenth at gcc dot gnu.org
@ 2014-09-09 13:57 ` ysrumyan at gmail dot com
2014-09-09 14:01 ` ysrumyan at gmail dot com
2014-09-09 14:04 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: ysrumyan at gmail dot com @ 2014-09-09 13:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62012
--- Comment #4 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
I checked that our benchmark is successfully vectorized with function inlining.
So this bug must be closed as fixed/resolved.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/62012] Loop is not vectorized after function inlining (SCEV)
2014-08-04 14:48 [Bug tree-optimization/62012] New: Loop is not vectorized after function inlining (SCEV) ysrumyan at gmail dot com
` (3 preceding siblings ...)
2014-09-09 13:57 ` ysrumyan at gmail dot com
@ 2014-09-09 14:01 ` ysrumyan at gmail dot com
2014-09-09 14:04 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: ysrumyan at gmail dot com @ 2014-09-09 14:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62012
--- Comment #5 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
You can close this bug as fixed/resolved (see my comment).
Thanks.
Yuri.
2014-09-08 15:29 GMT+04:00 rguenth at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org>:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62012
>
> Richard Biener <rguenth at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Status|UNCONFIRMED |WAITING
> Last reconfirmed| |2014-09-08
> Ever confirmed|0 |1
>
> --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
> So it's independend of LTO.
>
> Confirmed. We have
>
> _28 = &MEM[(struct Array *)&fa + 256B].a[0] + _3;
> *_28 = u_23;
>
> which SCEV messes up because it ends up with
>
> (instantiate_scev
> (instantiate_below = 4)
> (evolution_loop = 1)
> (chrec = &MEM[(struct Array *)&fa + 256B].a[0])
> (res = &MEM[(struct Array *)&fa + 256B].a[0]))
> (instantiate_scev
> (instantiate_below = 4)
> (evolution_loop = 1)
> (chrec = {(long unsigned int) first_6(D) * 4, +, 4}_1)
> (res = {(long unsigned int) first_6(D) * 4, +, 4}_1))
> (set_scalar_evolution
> instantiated_below = 4
> (scalar = _13)
> (scalar_evolution = {&MEM[(struct Array *)&fa + 256B].a[(sizetype)
> first_6(D)], +, 4}_1))
> )
> failed: evolution of base is not affine.
>
> Not sure why it thinks that.
>
> Btw, on trunk we now vectorize this just fine probably because of the fix
> for PR63148 which avoids moving first_6 * 4 inside the array-ref and we
> get
>
> (scalar_evolution = {&MEM[(struct Array *)&fa + 256B].a[0] + (sizetype)
> ((long unsigned int) first_6(D) * 4), +, 4}_1))
> )
> success.
>
> instead.
>
> So - can you re-check please?
>
> --
> You are receiving this mail because:
> You reported the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/62012] Loop is not vectorized after function inlining (SCEV)
2014-08-04 14:48 [Bug tree-optimization/62012] New: Loop is not vectorized after function inlining (SCEV) ysrumyan at gmail dot com
` (4 preceding siblings ...)
2014-09-09 14:01 ` ysrumyan at gmail dot com
@ 2014-09-09 14:04 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-09-09 14:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62012
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-09 14:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-04 14:48 [Bug tree-optimization/62012] New: Loop is not vectorized after function inlining (SCEV) ysrumyan at gmail dot com
2014-08-04 14:51 ` [Bug tree-optimization/62012] " ysrumyan at gmail dot com
2014-09-08 10:59 ` ysrumyan at gmail dot com
2014-09-08 11:29 ` rguenth at gcc dot gnu.org
2014-09-09 13:57 ` ysrumyan at gmail dot com
2014-09-09 14:01 ` ysrumyan at gmail dot com
2014-09-09 14:04 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).