This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23622] New: Dom jump threading at -O1 confuses branch prediction
- From: "rakdver at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2005 11:54:27 -0000
- Subject: [Bug tree-optimization/23622] New: Dom jump threading at -O1 confuses branch prediction
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Given a loop
for (i = 0; i < 100; i++)
something ();
translated as
L1:
i_1 = phi (0, i_2)
if (i_1 > 100)
goto exit;
L2:
something ();
i_2 = i_1 + 1;
goto L1;
Jump threading in dom1 produces
i_3 = phi(0);
goto L2;
L1:
i_1 = phi(i_2);
if (i_1 > 100)
goto exit;
L2:
i_4 = phi (i_3, i_1)
something ();
i_2 = i_4 + 1;
goto L1;
Since dom does not iterate at -O1, the phi nodes with one argument
(in particular, i_3 = phi(0)) are not removed. This prevents # of iterations
analysis from determining that the loop iterates a constant number of times,
since it does not handle such phi nodes. Consequently we lose the corresponding
branch predictor for this loop.
--
Summary: Dom jump threading at -O1 confuses branch prediction
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rakdver at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23622