This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lno] merge tree-ssa-phiopt and improve it


Since the tree-ssa is frozen as it is going to be merged into the mainline, I am going to
apply this patch into the lno branch. I did a merge of tree-ssa-phiopt.c while I was at it
but I had to revert part of the changes from the tree-ssa for renaming some global variables,
tree_dump_flags and tree_dump_file.
So there are three improvements I made to optimization:
1. I have it find ABS expressions which decreases how much the rtl ifcvt has to work.
2. I have it find places where it can be replaced with just a variable/constant as
in (a!=b)?a:b into a which is already done by fold and the RTL ifcvt but other options
can come about because of it, like sibcalling.
3. Cases in the original which code which was being rejected as it would create non-gimple
code, I fixed up so that the use of a temporary variable to hold the values.



Number 2 helps fix PR 14135, one more optimization is needed to fix that one totally.
Number 3 helps fix PR 6883 but only with the loop problem.


I am just attaching the file as there are so many minuses due to the merge of the file and so
many new code that it does not makes sense to give a patch.


For who ever does the next merge from the tree-ssa to lno branch, I will merge the changes
needed for tree-ssa-phiopt for them



ChangeLog.tree-ssa (for the merge):


2004-03-03 Jeff Law <law@redhat.com>

* tree-ssa-phiopt.c (conditional_replacement): Clear EDGE_TRUE_VALUE
and EDGE_FALSE_VALUE on the remaining edge after eliminating a PHI.


2004-02-27 Jeff Law <law@redhat.com>

        * tree-ssa-phiopt.c (conditional_replacement): Do not create
        non-gimple code.

2004-02-26 Andrew Pinski <pinskia@physics.uc.edu>

        * tree-ssa-phiopt.c (tree_ssa_phiopt): Split into ...
        (conditional_replacement): Here.


ChangeLog.lno (for the changes):


2004-03-08 Andrew Pinski <apinski@apple.com>

        * tree-ssa-phiopt.c (make_temp): New function.
        (tree_ssa_phiopt): Use absolute_replacement
        and value_replacement.
        (conditional_replacement): Handle the case
        the conditional is not a variable and
        the types do not match.
        Handle the case where invert_truthvalue
        would create non-gimple.
        (absolute_replacement): New function.
        (value_replacement): New function.



Attachment: tree-ssa-phiopt.c
Description: Text document




Also here are the testcases which I committed along side the patch.

Attachment: 20040308-1.c
Description: Text document

Attachment: 20040308-2.c
Description: Text document

Attachment: 20040308-3.c
Description: Text document

Attachment: 20040308-4.c
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]