This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Do pointer comparison first in operand_equal_p
- From: Roger Sayle <roger at eyesopen dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 13 May 2005 09:19:42 -0600 (MDT)
- Subject: Re: [RFC] Do pointer comparison first in operand_equal_p
On Fri, 13 May 2005, Diego Novillo wrote:
> Jeff had some doubts about the approach. Roger, what do you
> think? Any reason why this would be unsafe in general?
Hi Diego,
The problem that I see with this is its interaction with the
OEP_CONST_ONLY and OEP_PURE_SAME flags. When the tree-ssa branch
was merged into mainline, it brought along Jeff's changes to
operand_equal_p to allow the tree-optimizers to specify that they
only want constants considered equal iff OEP_CONST_ONLY was
specified.
See:
>> 2004-05-13 Diego Novillo <dnovillo@redhat.com>
>> Merge from tree-ssa-20020619-branch.
The side-effect is that this increases the critical path length of
operand_equal_p, which is heavily used. Perhaps a better approach
would be to split up the two functionalities, into operand_equal_p
and constant_equal_p (and maybe pure_call_equal_p) such that each
implementation attempts to reuse as much as possible, but its
optimized for it's particular usage.
i.e. operand_equal_p could call constant_equal_p for constants,
allowing the pointer comparison to occur first in the former.
As written your patch may break stuff.
Roger
--