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]

Re: [PATCH]: Implement must-def kill operand



On Oct 20, 2004, at 4:32 PM, Diego Novillo wrote:


On Wed, 2004-10-20 at 14:20, Daniel Berlin wrote:

1. Do a quick propagation pass in DCE to make sure def-def phis that
are used in necessary statements don't die. (at that point, plain
def-def renaming will work)
2. Mark the must-def operand as necessary if it's a phi, and the only
immediate use of the phi is in the must-def operand (I'm assuming it
could appear in a may-def or vuse somewhere else, in which case it's
necessary).
3. Use the full renamer, which will simply put the phi back after DCE
removes it.

4. If the RHS of a V_MUST_DEF is a PHI node, mark it necessary?

That's #1, actually.


Before remove_stmts, i meant you do this:

FOR EACH MUSTDEF:
If RHS is a phi node and marked unnecessary:
	add phi node to worklist.


Until worklist is empty:
pop phi off worklist. Mark as necessary.
For each phi node argument that is a phi node marked unnecessary, add to worklist.


This also catches the mutually recursive phis like:
a_1 = phi <a_2, <a_something>>
a_2 = phi <a_4, a_1>

a_4 = must_def <a_2>

You actually have to worklist it because those phi nodes may use phi nodes, and you have to mark those phi nodes as necessary as well.
:)




Diego.



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