[Webkit-unassigned] [Bug 80415] Eliminate redundant Phis in DFG

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 6 17:34:41 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=80415





--- Comment #7 from Filip Pizlo <fpizlo at apple.com>  2012-03-06 17:34:41 PST ---
(In reply to comment #6)
> (In reply to comment #4)
> > I think this is great.  My intuition is that we could simplify this further by doing away with the phi use map.  But maybe I'm wrong?  Have you tried it without the use map?
> 
> No, I haven't tried it - I was just worried that traversing the whole graph for Phi replacement may be time consuming especially when the traversal can be iterative. We can try it and I think we should only need the iterative traversal on the Phi nodes (if we have the fix of bug 80361 it would be easier) and a one-time traversal on other nodes in the graph (actually, at current stage, the GetLocals) after all of the Phi replacements are identified.

It seems like one way around this is to just track the Phis, and not the Phi uses.

We can first do a fixpoint where we simplify Phis only - which may leave dummy Phis like:

somePhi: Phi(@something)

where @something is either another Phi or something real (like a SetLocal), and somePhi is still referenced from various other places (GetLocal, etc).

Then we can do a second pass that considers all nodes (not just Phis) and checks if those nodes reference trivial Phis.  If they do, then replace.

I think that this should be sufficient, since the fixpoint (as I understand it) only depends on the shape of Phis and not the shapes of users of Phis.  So you only need to visit Phis repeatedly - and after that you can visit all non-Phi uses of Phis in one go.

Would that work?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list