Closed Bug 669796 Opened 13 years ago Closed 10 years ago

IonMonkey: perform unreachable code elimination during GVN

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1029830

People

(Reporter: rpearl, Assigned: rpearl)

References

(Blocks 1 open bug)

Details

(Whiteboard: [ion:t])

Follow up to Bug 659729. I think it's probably natural to perform unreachable code elimination during the GVN pass--I'll see if I can make this work.
Could you summarize your design/algorithm idea here?
Sorry, this dropped out of sight. The algorithm would be something like: Assume that the start block is reachable. Assume that all other blocks and edges are unreachable. Examine control flow instructions during GVN: If an outgoing edge can be followed, mark it reachable. Once an edge becomes reachable, the target blocks of that edge become reachable. Inputs of phi nodes from unreachable edges are ignored.
Is this still needed?
Bug 620767 provides a similar optimization, though it is not integrated with GVN.
My mistake, bug 620676
Sorry for the spam! I cannot type, apparently. Bug 820676!
One advantage to doing the integration proposed in this bug would be better handling of code like the following: if (foo() && false) { ... } In this case we currently fail to optimize away the body. This is because the |foo() && false| is first stored into a variable, and at the time the pass runs the constants have not been fully propagated. This situation arises in self-hosted code for ParallelArray, where inlined functions are often evaluated to true or false to select different control flow in sequential or parallel mode.
The new GVN implementation (bug 1004363) is capable of this. Bug 1029830 tracks enabling it.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.