This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64700] New: Sink common code through PHI
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Jan 2015 22:01:02 +0000
- Subject: [Bug tree-optimization/64700] New: Sink common code through PHI
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64700
Bug ID: 64700
Summary: Sink common code through PHI
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: law at redhat dot com
Created attachment 34507
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34507&action=edit
Testcode
Originally from BZ 64081....
We do miss some interesting kind of optimization opportunities like
transforming
if (prephitmp_87 == 1)
goto <bb 9>;
else
goto <bb 10>;
<bb 9>:
_24 = arr1.5_23 + _62;
pos.6_25 = *_24;
goto <bb 11>;
<bb 10>:
_28 = arr2.7_27 + _62;
pos.8_29 = *_28;
<bb 11>:
# prephitmp_89 = PHI <pos.6_25(9), pos.8_29(10)>
to
if (prephitmp_87 == 1)
goto <bb 9>;
else
goto <bb 11>;
<bb 9>:
goto <bb 11>;
<bb 11>:
# _24 = PHI <arr1.5_23, arr2.7_27>
_28 = _24 + _62;
prephitmp_89 = *_28;
sinking common computations through a PHI.
With the followup optimization in out-of-SSA to coalesce arr1.5_23 and
arr2.7_27 which means we can drop the conditional entirely.