This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcse pass: expression hash table
- From: James E Wilson <wilson at specifixinc dot com>
- To: Tarun Kawatra <tarun at cse dot iitb dot ac dot in>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 23 Feb 2005 16:17:27 -0800
- Subject: Re: gcse pass: expression hash table
- References: <Pine.LNX.4.61.0502231538370.1032@mars.cse.iitb.ac.in>
Tarun Kawatra wrote:
During expression hash table construction in gcse pass(gcc vercion
3.4.1), expressions like a*b does not get included into the expression
hash table. Such expressions occur in PARALLEL along with clobbers.
You didn't mention the target, or exactly what the mult looks like.
However, this isn't hard to answer just by using the source.
hash_scan_set calls want_to_cse_p calls can_assign_to_reg_p calls
added_clobbers_hard_reg_p which presumably returns true, which prevents
the optimization. This makes sense. If the pattern clobbers a hard
reg, then we can't safely insert it at any place in the function. It
might be clobbering the hard reg at a point where it holds a useful value.
While looking at this, I noticed can_assign_to_reg_p does something
silly. It uses "FIRST_PSEUDO_REGISTER * 2" to try to generate a test
pseudo register, but this can fail if a target has less than 4
registers, or if the set of virtual registers increases in the future.
This should probably be LAST_VIRTUAL_REGISTER + 1 as used in another
recent patch.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com