public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs
@ 2008-12-11 23:22 pinskia at gcc dot gnu dot org
2008-12-11 23:25 ` [Bug tree-optimization/38497] " pinskia at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-11 23:22 UTC (permalink / raw)
To: gcc-bugs
Testcase:
void DoHuffIteration(int);
int f(int *a)
{
int i;
int plaintextlen=*a;
for(i = 0; i< 10000; i++)
DoHuffIteration(*a);
return *a - plaintextlen;
}
--- CUT ---
There is a load of *a after that loop even though we could have placed the load
inside the loop after the call.
--
Summary: PRE missing a load PRE which causes a loop to have two
BBs
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/38497] PRE missing a load PRE which causes a loop to have two BBs
2008-12-11 23:22 [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs pinskia at gcc dot gnu dot org
@ 2008-12-11 23:25 ` pinskia at gcc dot gnu dot org
2010-03-02 19:01 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-11 23:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-11 23:24 -------
This is a reduced testcase from The huffman byte benchmark.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/38497] PRE missing a load PRE which causes a loop to have two BBs
2008-12-11 23:22 [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs pinskia at gcc dot gnu dot org
2008-12-11 23:25 ` [Bug tree-optimization/38497] " pinskia at gcc dot gnu dot org
@ 2010-03-02 19:01 ` pinskia at gcc dot gnu dot org
2010-03-03 10:43 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-02 19:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2010-03-02 19:01 -------
Still happens as of today on the trunk.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/38497] PRE missing a load PRE which causes a loop to have two BBs
2008-12-11 23:22 [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs pinskia at gcc dot gnu dot org
2008-12-11 23:25 ` [Bug tree-optimization/38497] " pinskia at gcc dot gnu dot org
2010-03-02 19:01 ` pinskia at gcc dot gnu dot org
@ 2010-03-03 10:43 ` rguenth at gcc dot gnu dot org
2010-03-03 10:57 ` steven at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-03 10:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2010-03-03 10:43 -------
This isn't PRE but code hoisting which we have a dup for.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |stevenb dot gcc at gmail dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/38497] PRE missing a load PRE which causes a loop to have two BBs
2008-12-11 23:22 [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-03-03 10:43 ` rguenth at gcc dot gnu dot org
@ 2010-03-03 10:57 ` steven at gcc dot gnu dot org
2010-03-03 11:03 ` rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu dot org @ 2010-03-03 10:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from steven at gcc dot gnu dot org 2010-03-03 10:57 -------
I think pinskia means we could transform the test case of comment #0 to:
void DoHuffIteration(int);
int f(int *a)
{
int i;
int plaintextlen=*a;
pretmp = plaintextlen;
for(i = 0; i< 10000; i++)
{
DoHuffIteration(pretmp);
pretmp = *a;
}
return pretmp - plaintextlen;
}
which makes this PRE, not hoisting.
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|stevenb dot gcc at gmail dot|
|com |
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-03-03 10:57:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/38497] PRE missing a load PRE which causes a loop to have two BBs
2008-12-11 23:22 [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2010-03-03 10:57 ` steven at gcc dot gnu dot org
@ 2010-03-03 11:03 ` rguenth at gcc dot gnu dot org
2010-03-03 14:26 ` steven at gcc dot gnu dot org
2010-05-05 10:31 ` rguenth at gcc dot gnu dot org
6 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-03 11:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2010-03-03 11:03 -------
I'm not so sure. We start with
<bb 2>:
plaintextlen_3 = *a_2(D);
<bb 3>:
# i_13 = PHI <i_6(5), 0(2)>
D.2725_5 = *a_2(D);
DoHuffIteration (D.2725_5);
i_6 = i_13 + 1;
if (i_6 <= 9999)
goto <bb 5>;
else
goto <bb 4>;
<bb 5>:
goto <bb 3>;
<bb 4>:
D.2725_7 = *a_2(D);
so *a_2 (4) is antic-out in bb3 but dies in bb3 (thus it's not antic-in there).
*a_2 (3) is antic-in in bb5 and available in bb2. Thus we insert in bb5:
<bb 2>:
plaintextlen_3 = *a_2(D);
<bb 3>:
# i_13 = PHI <i_6(5), 0(2)>
# prephitmp.3_14 = PHI <pretmp.2_1(5), plaintextlen_3(2)>
D.2725_5 = prephitmp.3_14;
DoHuffIteration (D.2725_5);
i_6 = i_13 + 1;
if (i_6 <= 9999)
goto <bb 5>;
else
goto <bb 4>;
<bb 5>:
pretmp.2_1 = *a_2(D);
goto <bb 3>;
<bb 4>:
D.2725_7 = *a_2(D);
now what is left is hoisting *a_2(D) to after the call. But that's not PRE.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/38497] PRE missing a load PRE which causes a loop to have two BBs
2008-12-11 23:22 [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2010-03-03 11:03 ` rguenth at gcc dot gnu dot org
@ 2010-03-03 14:26 ` steven at gcc dot gnu dot org
2010-05-05 10:31 ` rguenth at gcc dot gnu dot org
6 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu dot org @ 2010-03-03 14:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from steven at gcc dot gnu dot org 2010-03-03 14:26 -------
Well, it is not hoisting, either.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/38497] PRE missing a load PRE which causes a loop to have two BBs
2008-12-11 23:22 [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs pinskia at gcc dot gnu dot org
` (5 preceding siblings ...)
2010-03-03 14:26 ` steven at gcc dot gnu dot org
@ 2010-05-05 10:31 ` rguenth at gcc dot gnu dot org
6 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-05 10:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from rguenth at gcc dot gnu dot org 2010-05-05 10:30 -------
As *a_2(D) is ANTIC_OUT in bb3 (but not ANTIC_IN in bb3 because it dies in
there)
can we insert in bb3 instead of in bb5?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38497
^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <bug-38497-4@http.gcc.gnu.org/bugzilla/>]
end of thread, other threads:[~2021-08-22 4:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-11 23:22 [Bug tree-optimization/38497] New: PRE missing a load PRE which causes a loop to have two BBs pinskia at gcc dot gnu dot org
2008-12-11 23:25 ` [Bug tree-optimization/38497] " pinskia at gcc dot gnu dot org
2010-03-02 19:01 ` pinskia at gcc dot gnu dot org
2010-03-03 10:43 ` rguenth at gcc dot gnu dot org
2010-03-03 10:57 ` steven at gcc dot gnu dot org
2010-03-03 11:03 ` rguenth at gcc dot gnu dot org
2010-03-03 14:26 ` steven at gcc dot gnu dot org
2010-05-05 10:31 ` rguenth at gcc dot gnu dot org
[not found] <bug-38497-4@http.gcc.gnu.org/bugzilla/>
2021-08-22 4:04 ` pinskia 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).