This is the mail archive of the 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]

Re: [tree-ssa] Removing redundant loads

In message <>, Jason Merrill writes:
 >On Fri, 30 May 2003 08:13:37 -0600, wrote:
 >> The fundamental problem is while iterative_hash_expr knows how to deal with
 >> commutative operations, avail_expr_hash does not.  Thus we get different
 >> hashes because the order of operands in the use operands array is different
 >> between the two statements.  Ugh.  We're probably going to have the same 
 >> problem with VUSE/VDEFs.
 >A simple fix would be to combine the hashes for the operands in a
 >commutative way, such as addition or xor, rather than feed the previous
 >value back into iterative_hash_*.
For the real uses, I'm just going to have avail_expr_hash use
iterative_hash_expr, which already does the right thing.  It seems kindof
silly to duplicate the code.

Yes, we're probably going to have to sort the virtual operands.  What fun.

 >Of course, avail_expr_eq will also need to deal with this issue; perhaps
 >sorting the ops/vops vecs is the way to go.
Yes, avail_expr_eq has the same issue, but it's a little more "interesting"
in that we call back to simple_cst_equal which doesn't handle commutative
expressions well.

In a lot of ways this argues that we should have a canonical form for 
commutative expressions, but I'm not quite annoyed enough yet to make
that invasive of a change.


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