ion: |a && false| is incompletely optimized

RESOLVED DUPLICATE of bug 669796

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 669796
5 years ago
5 years ago

People

(Reporter: nmatsakis, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
There is now a pass to strip dead or unreachable blocks, but it fails with code like:

    if (foo() && false) { ... }

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.

Probably the best fix would be to integrate the stripping of unreachable blocks with GVN as proposed in Bug 669796.
(Reporter)

Comment 1

5 years ago
actually I decided to just call this a dup of bug 669796 and add my comments there.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 669796
You need to log in before you can comment on or make changes to this bug.